source: imaps-frontend/node_modules/konva/lib/shapes/Wedge.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.4 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Wedge = void 0;
4const Factory_1 = require("../Factory");
5const Shape_1 = require("../Shape");
6const Global_1 = require("../Global");
7const Validators_1 = require("../Validators");
8const Global_2 = require("../Global");
9class Wedge extends Shape_1.Shape {
10 _sceneFunc(context) {
11 context.beginPath();
12 context.arc(0, 0, this.radius(), 0, Global_1.Konva.getAngle(this.angle()), this.clockwise());
13 context.lineTo(0, 0);
14 context.closePath();
15 context.fillStrokeShape(this);
16 }
17 getWidth() {
18 return this.radius() * 2;
19 }
20 getHeight() {
21 return this.radius() * 2;
22 }
23 setWidth(width) {
24 this.radius(width / 2);
25 }
26 setHeight(height) {
27 this.radius(height / 2);
28 }
29}
30exports.Wedge = Wedge;
31Wedge.prototype.className = 'Wedge';
32Wedge.prototype._centroid = true;
33Wedge.prototype._attrsAffectingSize = ['radius'];
34(0, Global_2._registerNode)(Wedge);
35Factory_1.Factory.addGetterSetter(Wedge, 'radius', 0, (0, Validators_1.getNumberValidator)());
36Factory_1.Factory.addGetterSetter(Wedge, 'angle', 0, (0, Validators_1.getNumberValidator)());
37Factory_1.Factory.addGetterSetter(Wedge, 'clockwise', false);
38Factory_1.Factory.backCompat(Wedge, {
39 angleDeg: 'angle',
40 getAngleDeg: 'getAngle',
41 setAngleDeg: 'setAngle',
42});
Note: See TracBrowser for help on using the repository browser.