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:
961 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | exports.Rect = void 0;
|
---|
4 | const Factory_1 = require("../Factory");
|
---|
5 | const Shape_1 = require("../Shape");
|
---|
6 | const Global_1 = require("../Global");
|
---|
7 | const Util_1 = require("../Util");
|
---|
8 | const Validators_1 = require("../Validators");
|
---|
9 | class Rect extends Shape_1.Shape {
|
---|
10 | _sceneFunc(context) {
|
---|
11 | var cornerRadius = this.cornerRadius(), width = this.width(), height = this.height();
|
---|
12 | context.beginPath();
|
---|
13 | if (!cornerRadius) {
|
---|
14 | context.rect(0, 0, width, height);
|
---|
15 | }
|
---|
16 | else {
|
---|
17 | Util_1.Util.drawRoundedRectPath(context, width, height, cornerRadius);
|
---|
18 | }
|
---|
19 | context.closePath();
|
---|
20 | context.fillStrokeShape(this);
|
---|
21 | }
|
---|
22 | }
|
---|
23 | exports.Rect = Rect;
|
---|
24 | Rect.prototype.className = 'Rect';
|
---|
25 | (0, Global_1._registerNode)(Rect);
|
---|
26 | Factory_1.Factory.addGetterSetter(Rect, 'cornerRadius', 0, (0, Validators_1.getNumberOrArrayOfNumbersValidator)(4));
|
---|
Note:
See
TracBrowser
for help on using the repository browser.