UNPKG

@minofrk/xelto-diagram-canvas

Version:

An implementation of <xelto-diagram> in TypeScript.

37 lines 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const brushes_1 = require("../../brushes"); const point_ops_1 = require("../../point-ops"); const make_piece_image_1 = require("./make-piece-image"); const width = 1 / Math.sqrt(2); const gap = point_ops_1.square((2 - width) / 2); const upperPlayerLeftTop = { x: 0, y: 1 }; const lowerPlayerLeftTop = { x: 22, y: 13 }; const makeDiamondBrush = (leftTop) => brushes_1.fillDiamond({ color: '#000', virtualArea: { leftTop: point_ops_1.plus(leftTop, gap), size: point_ops_1.square(width), }, }); function* makePlayerImage(sast) { if (sast === 'arxe') { yield makeDiamondBrush(lowerPlayerLeftTop); } else { yield makeDiamondBrush(upperPlayerLeftTop); } } exports.makePlayerImage = makePlayerImage; function* makeAllErrorPlayerImage() { yield* make_piece_image_1.makeErrorPieceImage({ leftTop: upperPlayerLeftTop, size: { x: 2, y: 2 }, }); yield* make_piece_image_1.makeErrorPieceImage({ leftTop: lowerPlayerLeftTop, size: { x: 2, y: 2 }, }); } exports.makeAllErrorPlayerImage = makeAllErrorPlayerImage; //# sourceMappingURL=make-player-image.js.map