source: imaps-frontend/node_modules/konva/lib/shapes/Circle.js

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

Update repo after prototype presentation

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