source: imaps-frontend/node_modules/konva/lib/shapes/Ring.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.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Ring = void 0;
4const Factory_1 = require("../Factory");
5const Shape_1 = require("../Shape");
6const Validators_1 = require("../Validators");
7const Global_1 = require("../Global");
8var PIx2 = Math.PI * 2;
9class Ring extends Shape_1.Shape {
10 _sceneFunc(context) {
11 context.beginPath();
12 context.arc(0, 0, this.innerRadius(), 0, PIx2, false);
13 context.moveTo(this.outerRadius(), 0);
14 context.arc(0, 0, this.outerRadius(), PIx2, 0, true);
15 context.closePath();
16 context.fillStrokeShape(this);
17 }
18 getWidth() {
19 return this.outerRadius() * 2;
20 }
21 getHeight() {
22 return this.outerRadius() * 2;
23 }
24 setWidth(width) {
25 this.outerRadius(width / 2);
26 }
27 setHeight(height) {
28 this.outerRadius(height / 2);
29 }
30}
31exports.Ring = Ring;
32Ring.prototype.className = 'Ring';
33Ring.prototype._centroid = true;
34Ring.prototype._attrsAffectingSize = ['innerRadius', 'outerRadius'];
35(0, Global_1._registerNode)(Ring);
36Factory_1.Factory.addGetterSetter(Ring, 'innerRadius', 0, (0, Validators_1.getNumberValidator)());
37Factory_1.Factory.addGetterSetter(Ring, 'outerRadius', 0, (0, Validators_1.getNumberValidator)());
Note: See TracBrowser for help on using the repository browser.