@nasser-sw/fabric 7.0.1-beta5 → 7.0.1-beta6
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/index.js +11 -17
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +11 -17
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +11 -17
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +11 -17
- package/dist/index.node.mjs.map +1 -1
- package/dist/src/shapes/Line.d.ts.map +1 -1
- package/dist/src/shapes/Line.min.mjs +1 -1
- package/dist/src/shapes/Line.min.mjs.map +1 -1
- package/dist/src/shapes/Line.mjs +11 -17
- package/dist/src/shapes/Line.mjs.map +1 -1
- package/dist-extensions/src/shapes/Line.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shapes/Line.ts +3 -6
package/dist/index.js
CHANGED
|
@@ -17634,14 +17634,10 @@
|
|
|
17634
17634
|
};
|
|
17635
17635
|
}
|
|
17636
17636
|
_p1PositionHandler() {
|
|
17637
|
-
|
|
17638
|
-
const vpt = ((_this$canvas = this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.viewportTransform) || [1, 0, 0, 1, 0, 0];
|
|
17639
|
-
return new Point(this.x1, this.y1).transform(vpt);
|
|
17637
|
+
return new Point(this.x1, this.y1).transform(this.getViewportTransform());
|
|
17640
17638
|
}
|
|
17641
17639
|
_p2PositionHandler() {
|
|
17642
|
-
|
|
17643
|
-
const vpt = ((_this$canvas2 = this.canvas) === null || _this$canvas2 === void 0 ? void 0 : _this$canvas2.viewportTransform) || [1, 0, 0, 1, 0, 0];
|
|
17644
|
-
return new Point(this.x2, this.y2).transform(vpt);
|
|
17640
|
+
return new Point(this.x2, this.y2).transform(this.getViewportTransform());
|
|
17645
17641
|
}
|
|
17646
17642
|
_renderEndpointControl(ctx, left, top) {
|
|
17647
17643
|
const size = 12;
|
|
@@ -17664,9 +17660,9 @@
|
|
|
17664
17660
|
return super.drawBorders(ctx, styleOverride, {});
|
|
17665
17661
|
}
|
|
17666
17662
|
_drawLineBorders(ctx) {
|
|
17667
|
-
var _this$
|
|
17663
|
+
var _this$canvas;
|
|
17668
17664
|
let styleOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17669
|
-
const vpt = ((_this$
|
|
17665
|
+
const vpt = ((_this$canvas = this.canvas) === null || _this$canvas === void 0 ? void 0 : _this$canvas.viewportTransform) || [1, 0, 0, 1, 0, 0];
|
|
17670
17666
|
ctx.save();
|
|
17671
17667
|
ctx.setTransform(vpt[0], vpt[1], vpt[2], vpt[3], vpt[4], vpt[5]);
|
|
17672
17668
|
ctx.strokeStyle = styleOverride.borderColor || this.borderColor || 'rgba(100, 200, 200, 0.5)';
|
|
@@ -17742,8 +17738,8 @@
|
|
|
17742
17738
|
}
|
|
17743
17739
|
containsPoint(point) {
|
|
17744
17740
|
if (this._useEndpointCoords) {
|
|
17745
|
-
var _this$
|
|
17746
|
-
if (((_this$
|
|
17741
|
+
var _this$canvas2;
|
|
17742
|
+
if (((_this$canvas2 = this.canvas) === null || _this$canvas2 === void 0 ? void 0 : _this$canvas2.getActiveObject()) === this) {
|
|
17747
17743
|
return super.containsPoint(point);
|
|
17748
17744
|
}
|
|
17749
17745
|
const distance = this._distanceToLineSegment(point.x, point.y);
|
|
@@ -17777,7 +17773,7 @@
|
|
|
17777
17773
|
return Math.sqrt((px - closestX) * (px - closestX) + (py - closestY) * (py - closestY));
|
|
17778
17774
|
}
|
|
17779
17775
|
_endpointActionHandler(eventData, transformData, x, y) {
|
|
17780
|
-
var _this$
|
|
17776
|
+
var _this$canvas4;
|
|
17781
17777
|
const controlKey = transformData.corner;
|
|
17782
17778
|
const pointer = new Point(x, y);
|
|
17783
17779
|
let newX = pointer.x;
|
|
@@ -17791,7 +17787,7 @@
|
|
|
17791
17787
|
newY = snapped.y;
|
|
17792
17788
|
}
|
|
17793
17789
|
if (this._useEndpointCoords) {
|
|
17794
|
-
var _this$
|
|
17790
|
+
var _this$canvas3;
|
|
17795
17791
|
if (controlKey === 'p1') {
|
|
17796
17792
|
this.x1 = newX;
|
|
17797
17793
|
this.y1 = newY;
|
|
@@ -17801,7 +17797,7 @@
|
|
|
17801
17797
|
}
|
|
17802
17798
|
this.dirty = true;
|
|
17803
17799
|
this.setCoords();
|
|
17804
|
-
(_this$
|
|
17800
|
+
(_this$canvas3 = this.canvas) === null || _this$canvas3 === void 0 || _this$canvas3.requestRenderAll();
|
|
17805
17801
|
return true;
|
|
17806
17802
|
}
|
|
17807
17803
|
|
|
@@ -17817,7 +17813,7 @@
|
|
|
17817
17813
|
this._setWidthHeight();
|
|
17818
17814
|
this.dirty = true;
|
|
17819
17815
|
this._updatingEndpoints = false;
|
|
17820
|
-
(_this$
|
|
17816
|
+
(_this$canvas4 = this.canvas) === null || _this$canvas4 === void 0 || _this$canvas4.requestRenderAll();
|
|
17821
17817
|
this.fire('modified', {
|
|
17822
17818
|
transform: transformData,
|
|
17823
17819
|
target: this,
|
|
@@ -17892,11 +17888,9 @@
|
|
|
17892
17888
|
super.render(ctx);
|
|
17893
17889
|
}
|
|
17894
17890
|
_renderDirectly(ctx) {
|
|
17895
|
-
var _this$
|
|
17891
|
+
var _this$stroke;
|
|
17896
17892
|
if (!this.visible) return;
|
|
17897
17893
|
ctx.save();
|
|
17898
|
-
const vpt = ((_this$canvas7 = this.canvas) === null || _this$canvas7 === void 0 ? void 0 : _this$canvas7.viewportTransform) || [1, 0, 0, 1, 0, 0];
|
|
17899
|
-
ctx.transform(vpt[0], vpt[1], vpt[2], vpt[3], vpt[4], vpt[5]);
|
|
17900
17894
|
ctx.globalAlpha = this.opacity;
|
|
17901
17895
|
ctx.strokeStyle = ((_this$stroke = this.stroke) === null || _this$stroke === void 0 ? void 0 : _this$stroke.toString()) || '#000';
|
|
17902
17896
|
ctx.lineWidth = this.strokeWidth;
|