@inweb/viewer-visualize 25.6.0 → 25.6.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/viewer-visualize.js +106 -58
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +88 -65
- package/dist/viewer-visualize.module.js.map +1 -1
- package/package.json +4 -4
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +1 -1
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaCloud.ts +14 -11
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +19 -14
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +25 -11
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +1 -1
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +14 -11
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +12 -9
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +1 -0
package/dist/viewer-visualize.js
CHANGED
|
@@ -14591,8 +14591,8 @@
|
|
|
14591
14591
|
});
|
|
14592
14592
|
this._ref.on("transform", (e) => {
|
|
14593
14593
|
const attrs = e.target.attrs;
|
|
14594
|
-
if (attrs.rotation !== this.
|
|
14595
|
-
this.
|
|
14594
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
14595
|
+
this._ref.rotation(attrs.rotation);
|
|
14596
14596
|
});
|
|
14597
14597
|
this._ref.id(this._ref._id.toString());
|
|
14598
14598
|
}
|
|
@@ -14693,19 +14693,25 @@
|
|
|
14693
14693
|
this._ref.width(this._ref.getTextWidth());
|
|
14694
14694
|
this._ref.on("transform", (e) => {
|
|
14695
14695
|
const attrs = e.target.attrs;
|
|
14696
|
-
if (attrs.rotation !== this.
|
|
14697
|
-
this.
|
|
14698
|
-
const
|
|
14699
|
-
const
|
|
14696
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
14697
|
+
this._ref.rotation(attrs.rotation);
|
|
14698
|
+
const scaleByX = Math.abs(attrs.scaleX - 1) > 10e-6;
|
|
14699
|
+
const scaleByY = Math.abs(attrs.scaleY - 1) > 10e-6;
|
|
14700
|
+
let newWidth = this._ref.width();
|
|
14701
|
+
if (scaleByX)
|
|
14702
|
+
newWidth *= attrs.scaleX;
|
|
14703
|
+
let newHeight = this._ref.height();
|
|
14704
|
+
if (scaleByY)
|
|
14705
|
+
newHeight *= attrs.scaleY;
|
|
14700
14706
|
const minWidth = 50;
|
|
14701
|
-
if (newWidth < minWidth
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
if (
|
|
14707
|
+
if (newWidth < minWidth)
|
|
14708
|
+
newWidth = minWidth;
|
|
14709
|
+
if (newHeight < Math.round(this.getFontSize()))
|
|
14710
|
+
newHeight = Math.round(this.getFontSize());
|
|
14711
|
+
if (scaleByX) {
|
|
14706
14712
|
this._ref.width(newWidth);
|
|
14707
14713
|
}
|
|
14708
|
-
if (
|
|
14714
|
+
if (scaleByY) {
|
|
14709
14715
|
this._ref.height(newHeight);
|
|
14710
14716
|
}
|
|
14711
14717
|
this._ref.scale({ x: 1, y: 1 });
|
|
@@ -14790,21 +14796,27 @@
|
|
|
14790
14796
|
});
|
|
14791
14797
|
this._ref.on("transform", (e) => {
|
|
14792
14798
|
const attrs = e.target.attrs;
|
|
14793
|
-
if (attrs.rotation !== this.
|
|
14794
|
-
this.
|
|
14795
|
-
|
|
14796
|
-
|
|
14799
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
14800
|
+
this._ref.rotation(attrs.rotation);
|
|
14801
|
+
const scaleByX = Math.abs(attrs.scaleX - 1) > 10e-6;
|
|
14802
|
+
const scaleByY = Math.abs(attrs.scaleY - 1) > 10e-6;
|
|
14803
|
+
let newWidth = this._ref.width();
|
|
14804
|
+
if (scaleByX)
|
|
14805
|
+
newWidth *= attrs.scaleX;
|
|
14806
|
+
let newHeight = this._ref.height();
|
|
14807
|
+
if (scaleByY)
|
|
14808
|
+
newHeight *= attrs.scaleY;
|
|
14797
14809
|
const minWidth = 50;
|
|
14798
14810
|
const minHeight = 50;
|
|
14799
|
-
if (newWidth < minWidth
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
if (
|
|
14804
|
-
this.
|
|
14811
|
+
if (newWidth < minWidth)
|
|
14812
|
+
newWidth = minWidth;
|
|
14813
|
+
if (newHeight < minHeight)
|
|
14814
|
+
newHeight = minHeight;
|
|
14815
|
+
if (scaleByX) {
|
|
14816
|
+
this._ref.width(newWidth);
|
|
14805
14817
|
}
|
|
14806
|
-
if (
|
|
14807
|
-
this.
|
|
14818
|
+
if (scaleByY) {
|
|
14819
|
+
this._ref.height(newHeight);
|
|
14808
14820
|
}
|
|
14809
14821
|
this._ref.scale({ x: 1, y: 1 });
|
|
14810
14822
|
});
|
|
@@ -14894,21 +14906,32 @@
|
|
|
14894
14906
|
});
|
|
14895
14907
|
this._ref.on("transform", (e) => {
|
|
14896
14908
|
const attrs = e.target.attrs;
|
|
14897
|
-
if (attrs.rotation !== this.
|
|
14898
|
-
this.
|
|
14899
|
-
const
|
|
14900
|
-
const
|
|
14909
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
14910
|
+
this._ref.rotation(attrs.rotation);
|
|
14911
|
+
const scaleByX = Math.abs(attrs.scaleX - 1) > 10e-6;
|
|
14912
|
+
const scaleByY = Math.abs(attrs.scaleY - 1) > 10e-6;
|
|
14913
|
+
let newRadiusX = this._ref.radiusX();
|
|
14914
|
+
if (scaleByX)
|
|
14915
|
+
newRadiusX *= attrs.scaleX;
|
|
14916
|
+
let newRadiusY = this._ref.radiusY();
|
|
14917
|
+
if (scaleByY)
|
|
14918
|
+
newRadiusY *= attrs.scaleY;
|
|
14901
14919
|
const minRadiusX = 25;
|
|
14902
14920
|
const minRadiusY = 25;
|
|
14903
|
-
if (newRadiusX < minRadiusX
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
14907
|
-
if (
|
|
14908
|
-
|
|
14921
|
+
if (newRadiusX < minRadiusX)
|
|
14922
|
+
newRadiusX = minRadiusX;
|
|
14923
|
+
if (newRadiusY < minRadiusY)
|
|
14924
|
+
newRadiusY = minRadiusY;
|
|
14925
|
+
if (e.evt.ctrlKey || e.evt.shiftKey) {
|
|
14926
|
+
if (scaleByX) {
|
|
14927
|
+
this._ref.radius({ x: newRadiusX, y: newRadiusX });
|
|
14928
|
+
}
|
|
14929
|
+
else {
|
|
14930
|
+
this._ref.radius({ x: newRadiusY, y: newRadiusY });
|
|
14931
|
+
}
|
|
14909
14932
|
}
|
|
14910
|
-
|
|
14911
|
-
this.
|
|
14933
|
+
else {
|
|
14934
|
+
this._ref.radius({ x: newRadiusX, y: newRadiusY });
|
|
14912
14935
|
}
|
|
14913
14936
|
this._ref.scale({ x: 1, y: 1 });
|
|
14914
14937
|
});
|
|
@@ -14997,8 +15020,8 @@
|
|
|
14997
15020
|
});
|
|
14998
15021
|
this._ref.on("transform", (e) => {
|
|
14999
15022
|
const attrs = e.target.attrs;
|
|
15000
|
-
if (attrs.rotation !== this.
|
|
15001
|
-
this.
|
|
15023
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
15024
|
+
this._ref.rotation(attrs.rotation);
|
|
15002
15025
|
});
|
|
15003
15026
|
this._ref.id(this._ref._id.toString());
|
|
15004
15027
|
}
|
|
@@ -15100,15 +15123,33 @@
|
|
|
15100
15123
|
this._canvasImage.src = params.src;
|
|
15101
15124
|
this._ref.on("transform", (e) => {
|
|
15102
15125
|
const attrs = e.target.attrs;
|
|
15103
|
-
if (attrs.rotation !== this.
|
|
15104
|
-
this.
|
|
15105
|
-
const
|
|
15106
|
-
const
|
|
15107
|
-
|
|
15108
|
-
|
|
15126
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
15127
|
+
this._ref.rotation(attrs.rotation);
|
|
15128
|
+
const scaleByX = Math.abs(attrs.scaleX - 1) > 10e-6;
|
|
15129
|
+
const scaleByY = Math.abs(attrs.scaleY - 1) > 10e-6;
|
|
15130
|
+
let newWidth = this._ref.width();
|
|
15131
|
+
if (scaleByX)
|
|
15132
|
+
newWidth *= attrs.scaleX;
|
|
15133
|
+
let newHeight = this._ref.height();
|
|
15134
|
+
if (scaleByY)
|
|
15135
|
+
newHeight *= attrs.scaleY;
|
|
15136
|
+
if (e.evt.ctrlKey || e.evt.shiftKey) {
|
|
15137
|
+
if (scaleByX) {
|
|
15138
|
+
this._ref.width(newWidth);
|
|
15139
|
+
this._ref.height(newWidth * this._ratio);
|
|
15140
|
+
}
|
|
15141
|
+
else {
|
|
15142
|
+
this._ref.width(newHeight / this._ratio);
|
|
15143
|
+
this._ref.height(newHeight);
|
|
15144
|
+
}
|
|
15109
15145
|
}
|
|
15110
|
-
|
|
15111
|
-
|
|
15146
|
+
else {
|
|
15147
|
+
if (scaleByX) {
|
|
15148
|
+
this._ref.width(newWidth);
|
|
15149
|
+
}
|
|
15150
|
+
if (scaleByY) {
|
|
15151
|
+
this._ref.height(newHeight);
|
|
15152
|
+
}
|
|
15112
15153
|
}
|
|
15113
15154
|
this._ref.scale({ x: 1, y: 1 });
|
|
15114
15155
|
});
|
|
@@ -15241,21 +15282,27 @@
|
|
|
15241
15282
|
this._ref.className = "Cloud";
|
|
15242
15283
|
this._ref.on("transform", (e) => {
|
|
15243
15284
|
const attrs = e.target.attrs;
|
|
15244
|
-
if (attrs.rotation !== this.
|
|
15245
|
-
this.
|
|
15246
|
-
const
|
|
15247
|
-
const
|
|
15285
|
+
if (attrs.rotation !== this._ref.rotation())
|
|
15286
|
+
this._ref.rotation(attrs.rotation);
|
|
15287
|
+
const scaleByX = Math.abs(attrs.scaleX - 1) > 10e-6;
|
|
15288
|
+
const scaleByY = Math.abs(attrs.scaleY - 1) > 10e-6;
|
|
15289
|
+
let newWidth = this._ref.width();
|
|
15290
|
+
if (scaleByX)
|
|
15291
|
+
newWidth *= attrs.scaleX;
|
|
15292
|
+
let newHeight = this._ref.height();
|
|
15293
|
+
if (scaleByY)
|
|
15294
|
+
newHeight *= attrs.scaleY;
|
|
15248
15295
|
const minWidth = 100;
|
|
15249
15296
|
const minHeight = 100;
|
|
15250
|
-
if (newWidth < minWidth
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
if (
|
|
15255
|
-
this.
|
|
15297
|
+
if (newWidth < minWidth)
|
|
15298
|
+
newWidth = minWidth;
|
|
15299
|
+
if (newHeight < minHeight)
|
|
15300
|
+
newHeight = minHeight;
|
|
15301
|
+
if (scaleByX) {
|
|
15302
|
+
this._ref.width(newWidth);
|
|
15256
15303
|
}
|
|
15257
|
-
if (
|
|
15258
|
-
this.
|
|
15304
|
+
if (scaleByY) {
|
|
15305
|
+
this._ref.height(newHeight);
|
|
15259
15306
|
}
|
|
15260
15307
|
this._ref.scale({ x: 1, y: 1 });
|
|
15261
15308
|
});
|
|
@@ -15723,6 +15770,7 @@
|
|
|
15723
15770
|
const transformer = new Konva.Transformer({
|
|
15724
15771
|
shouldOverdrawWholeArea: false,
|
|
15725
15772
|
keepRatio: false,
|
|
15773
|
+
flipEnabled: false,
|
|
15726
15774
|
});
|
|
15727
15775
|
this._konvaTransformer = transformer;
|
|
15728
15776
|
layer.add(transformer);
|