@inweb/markup 26.5.0 → 26.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/markup.module.js
CHANGED
|
@@ -637,7 +637,7 @@ function getDistanceIn2D(p1, p2) {
|
|
|
637
637
|
|
|
638
638
|
class KonvaEllipse {
|
|
639
639
|
constructor(params, ref = null, worldTransformer = new WorldTransform) {
|
|
640
|
-
var _a, _b;
|
|
640
|
+
var _a, _b, _c;
|
|
641
641
|
this._worldTransformer = worldTransformer;
|
|
642
642
|
if (ref) {
|
|
643
643
|
this._ref = ref;
|
|
@@ -670,6 +670,10 @@ class KonvaEllipse {
|
|
|
670
670
|
y: 0
|
|
671
671
|
};
|
|
672
672
|
if (params.position2) {
|
|
673
|
+
(_a = params.radius) !== null && _a !== undefined ? _a : params.radius = {
|
|
674
|
+
x: 0,
|
|
675
|
+
y: 0
|
|
676
|
+
};
|
|
673
677
|
params.radius.x = getDistanceIn2D(params.position, params.position2);
|
|
674
678
|
if (params.position3) params.radius.y = getDistanceIn2D(params.position, params.position3); else params.radius.x = params.radius.y;
|
|
675
679
|
} else {
|
|
@@ -679,8 +683,8 @@ class KonvaEllipse {
|
|
|
679
683
|
};
|
|
680
684
|
}
|
|
681
685
|
this._ref = new Konva.Ellipse({
|
|
682
|
-
stroke: (
|
|
683
|
-
strokeWidth: (
|
|
686
|
+
stroke: (_b = params.color) !== null && _b !== undefined ? _b : "#ff0000",
|
|
687
|
+
strokeWidth: (_c = params.lineWidth) !== null && _c !== undefined ? _c : 4,
|
|
684
688
|
globalCompositeOperation: "source-over",
|
|
685
689
|
lineCap: "round",
|
|
686
690
|
lineJoin: "round",
|
|
@@ -1116,13 +1120,13 @@ class KonvaImage {
|
|
|
1116
1120
|
this._ref.width(params.maxHeight / this._ratio);
|
|
1117
1121
|
this._ref.height(params.maxHeight);
|
|
1118
1122
|
}
|
|
1119
|
-
const wcsEnd = this._worldTransformer.screenToWorld({
|
|
1120
|
-
x: params.position.x + this._ref.width(),
|
|
1121
|
-
y: params.position.y + this._ref.height()
|
|
1122
|
-
});
|
|
1123
|
-
this._ref.setAttr("wcsEnd", wcsEnd);
|
|
1124
1123
|
}
|
|
1125
1124
|
}
|
|
1125
|
+
const wcsEnd = this._worldTransformer.screenToWorld({
|
|
1126
|
+
x: params.position.x + this._ref.width(),
|
|
1127
|
+
y: params.position.y + this._ref.height()
|
|
1128
|
+
});
|
|
1129
|
+
this._ref.setAttr("wcsEnd", wcsEnd);
|
|
1126
1130
|
};
|
|
1127
1131
|
this._canvasImage.onerror = () => {
|
|
1128
1132
|
this._canvasImage.onerror = function() {};
|