kritzel-stencil 0.0.122 → 0.0.124
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/cjs/{index-BcrLbdO1.js → index-C05uAr89.js} +10 -4
- package/dist/cjs/index-C05uAr89.js.map +1 -0
- package/dist/cjs/{index-CFCyVs0_.js → index-UcX3pzju.js} +189 -98
- package/dist/cjs/index-UcX3pzju.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-brush-style_18.cjs.entry.js +15 -15
- package/dist/cjs/kritzel-brush-style_18.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +2 -2
- package/dist/cjs/stencil.cjs.js.map +1 -1
- package/dist/collection/classes/handlers/hover.handler.js +22 -0
- package/dist/collection/classes/handlers/hover.handler.js.map +1 -0
- package/dist/collection/classes/handlers/selection.handler.js +13 -17
- package/dist/collection/classes/handlers/selection.handler.js.map +1 -1
- package/dist/collection/classes/objects/base-object.class.js +6 -0
- package/dist/collection/classes/objects/base-object.class.js.map +1 -1
- package/dist/collection/classes/objects/path.class.js +92 -23
- package/dist/collection/classes/objects/path.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-box.class.js +2 -2
- package/dist/collection/classes/objects/selection-box.class.js.map +1 -1
- package/dist/collection/classes/objects/selection-group.class.js +2 -1
- package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
- package/dist/collection/classes/tools/eraser-tool.class.js +0 -1
- package/dist/collection/classes/tools/eraser-tool.class.js.map +1 -1
- package/dist/collection/classes/tools/selection-tool.class.js +3 -0
- package/dist/collection/classes/tools/selection-tool.class.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +9 -9
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/collection/components/shared/kritzel-color-palette/kritzel-color-palette.css +1 -1
- package/dist/collection/components/shared/kritzel-font-size/kritzel-font-size.css +1 -1
- package/dist/collection/components/shared/kritzel-stroke-size/kritzel-stroke-size.css +1 -1
- package/dist/collection/components/ui/kritzel-controls/kritzel-controls.css +1 -1
- package/dist/collection/interfaces/object.interface.js.map +1 -1
- package/dist/components/index.js +3 -3
- package/dist/components/kritzel-brush-style.js +1 -1
- package/dist/components/kritzel-color-palette.js +1 -1
- package/dist/components/kritzel-color.js +1 -1
- package/dist/components/kritzel-context-menu.js +1 -1
- package/dist/components/kritzel-control-brush-config.js +1 -1
- package/dist/components/kritzel-control-text-config.js +1 -1
- package/dist/components/kritzel-controls.js +1 -1
- package/dist/components/kritzel-cursor-trail.js +1 -1
- package/dist/components/kritzel-dropdown.js +1 -1
- package/dist/components/kritzel-editor.js +19 -19
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/kritzel-font-family.js +1 -1
- package/dist/components/kritzel-font-size.js +1 -1
- package/dist/components/kritzel-font.js +1 -1
- package/dist/components/kritzel-icon.js +1 -1
- package/dist/components/kritzel-stroke-size.js +1 -1
- package/dist/components/kritzel-tooltip.js +1 -1
- package/dist/components/kritzel-utility-panel.js +1 -1
- package/dist/components/{p-CqPrOhzi.js → p-BOj_wqdw.js} +4 -4
- package/dist/components/{p-CqPrOhzi.js.map → p-BOj_wqdw.js.map} +1 -1
- package/dist/components/{p-CEYRFk55.js → p-BY8BWGge.js} +4 -4
- package/dist/components/{p-CEYRFk55.js.map → p-BY8BWGge.js.map} +1 -1
- package/dist/components/{p-D-Rf05Ov.js → p-Bn5P7YQn.js} +5 -5
- package/dist/components/{p-D-Rf05Ov.js.map → p-Bn5P7YQn.js.map} +1 -1
- package/dist/components/{p-CIb4IA9u.js → p-C9usqwb5.js} +5 -5
- package/dist/components/{p-CIb4IA9u.js.map → p-C9usqwb5.js.map} +1 -1
- package/dist/components/{p-gDLg_PJJ.js → p-CF8ziFc4.js} +4 -4
- package/dist/components/{p-gDLg_PJJ.js.map → p-CF8ziFc4.js.map} +1 -1
- package/dist/components/{p-CDpq9L_H.js → p-CiT5gBDh.js} +3 -3
- package/dist/components/{p-CDpq9L_H.js.map → p-CiT5gBDh.js.map} +1 -1
- package/dist/components/{p-D1oFXBAp.js → p-Cn_kantt.js} +5 -5
- package/dist/components/{p-D1oFXBAp.js.map → p-Cn_kantt.js.map} +1 -1
- package/dist/components/{p-Ch8eM2R8.js → p-Cnc43o9b.js} +151 -25
- package/dist/components/p-Cnc43o9b.js.map +1 -0
- package/dist/components/{p-DIu9OTyP.js → p-CneTqrgt.js} +18 -18
- package/dist/components/{p-DIu9OTyP.js.map → p-CneTqrgt.js.map} +1 -1
- package/dist/components/{p-B2wWYPH8.js → p-CtiROna-.js} +3 -3
- package/dist/components/{p-B2wWYPH8.js.map → p-CtiROna-.js.map} +1 -1
- package/dist/components/{p-D0L3GqSK.js → p-Cw2ATHMj.js} +3 -3
- package/dist/components/{p-D0L3GqSK.js.map → p-Cw2ATHMj.js.map} +1 -1
- package/dist/components/{p-CxmkJbeV.js → p-D0sLslUq.js} +3 -3
- package/dist/components/{p-CxmkJbeV.js.map → p-D0sLslUq.js.map} +1 -1
- package/dist/components/{p-dCaxwGmu.js → p-DJN0U8pI.js} +10 -4
- package/dist/components/p-DJN0U8pI.js.map +1 -0
- package/dist/components/{p-COPOzWCn.js → p-DJaVT2yR.js} +54 -89
- package/dist/components/p-DJaVT2yR.js.map +1 -0
- package/dist/components/{p-C3E9PtD3.js → p-DMAzUKo6.js} +10 -10
- package/dist/components/{p-C3E9PtD3.js.map → p-DMAzUKo6.js.map} +1 -1
- package/dist/components/{p-DbPbyRLO.js → p-DSLY0tr5.js} +5 -5
- package/dist/components/{p-DbPbyRLO.js.map → p-DSLY0tr5.js.map} +1 -1
- package/dist/components/{p--2FkikYE.js → p-DpiklJU9.js} +3 -3
- package/dist/components/{p--2FkikYE.js.map → p-DpiklJU9.js.map} +1 -1
- package/dist/components/{p--tElassI.js → p-NZJPrwJV.js} +3 -3
- package/dist/components/{p--tElassI.js.map → p-NZJPrwJV.js.map} +1 -1
- package/dist/components/{p-BSS4UREq.js → p-ubNAWsY_.js} +9 -9
- package/dist/components/{p-BSS4UREq.js.map → p-ubNAWsY_.js.map} +1 -1
- package/dist/esm/{index-BPFXWTBp.js → index-BGl8znzE.js} +10 -4
- package/dist/esm/index-BGl8znzE.js.map +1 -0
- package/dist/esm/{index-DYLW4hYm.js → index-DO2IiM_o.js} +189 -98
- package/dist/esm/index-DO2IiM_o.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/kritzel-brush-style_18.entry.js +15 -15
- package/dist/esm/kritzel-brush-style_18.entry.js.map +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stencil.js +3 -3
- package/dist/esm/stencil.js.map +1 -1
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/p-BGl8znzE.js +3 -0
- package/dist/stencil/p-BGl8znzE.js.map +1 -0
- package/dist/stencil/p-DO2IiM_o.js +2 -0
- package/dist/stencil/p-DO2IiM_o.js.map +1 -0
- package/dist/stencil/{p-fa584641.entry.js → p-c64f6589.entry.js} +2 -2
- package/dist/stencil/{p-fa584641.entry.js.map → p-c64f6589.entry.js.map} +1 -1
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/stencil/stencil.esm.js.map +1 -1
- package/dist/types/classes/handlers/hover.handler.d.ts +6 -0
- package/dist/types/classes/handlers/selection.handler.d.ts +1 -1
- package/dist/types/classes/objects/base-object.class.d.ts +2 -0
- package/dist/types/classes/objects/path.class.d.ts +5 -1
- package/dist/types/classes/tools/selection-tool.class.d.ts +2 -0
- package/dist/types/interfaces/object.interface.d.ts +3 -0
- package/package.json +5 -5
- package/dist/cjs/index-BcrLbdO1.js.map +0 -1
- package/dist/cjs/index-CFCyVs0_.js.map +0 -1
- package/dist/components/p-COPOzWCn.js.map +0 -1
- package/dist/components/p-Ch8eM2R8.js.map +0 -1
- package/dist/components/p-dCaxwGmu.js.map +0 -1
- package/dist/esm/index-BPFXWTBp.js.map +0 -1
- package/dist/esm/index-DYLW4hYm.js.map +0 -1
- package/dist/stencil/p-BPFXWTBp.js +0 -3
- package/dist/stencil/p-BPFXWTBp.js.map +0 -1
- package/dist/stencil/p-DYLW4hYm.js +0 -2
- package/dist/stencil/p-DYLW4hYm.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-DJN0U8pI.js';
|
|
2
2
|
import { K as KritzelMouseButton } from './p-D8W6LE-c.js';
|
|
3
|
-
import { d as KritzelBaseObject, e as KritzelBaseCommand, f as KritzelBaseTool, g as KritzelEventHelper, c as KritzelTextTool, b as KritzelBrushTool, K as KritzelText, a as KritzelPath, O as ObjectHelper, A as AddObjectCommand, h as KritzelToolRegistry, i as KritzelKeyboardHelper } from './p-
|
|
4
|
-
import { K as KritzelContextMenu, d as defineCustomElement$3 } from './p-
|
|
5
|
-
import { d as defineCustomElement$2 } from './p-
|
|
6
|
-
import { d as defineCustomElement$1 } from './p-
|
|
3
|
+
import { d as KritzelBaseObject, e as KritzelBaseCommand, f as KritzelBaseTool, g as KritzelEventHelper, c as KritzelTextTool, b as KritzelBrushTool, K as KritzelText, a as KritzelPath, O as ObjectHelper, A as AddObjectCommand, h as KritzelToolRegistry, i as KritzelKeyboardHelper } from './p-Cnc43o9b.js';
|
|
4
|
+
import { K as KritzelContextMenu, d as defineCustomElement$3 } from './p-BY8BWGge.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './p-Cw2ATHMj.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './p-CtiROna-.js';
|
|
7
7
|
|
|
8
8
|
class KritzelImage extends KritzelBaseObject {
|
|
9
9
|
constructor(config) {
|
|
@@ -162,7 +162,6 @@ class KritzelEraserTool extends KritzelBaseTool {
|
|
|
162
162
|
const selectedObjects = this._store.getObjectsFromPointerEvent(event, '.object');
|
|
163
163
|
if (selectedObjects.length === 0)
|
|
164
164
|
return;
|
|
165
|
-
console.log('selectedObjects', selectedObjects);
|
|
166
165
|
const x = this._store.state.pointerX;
|
|
167
166
|
const y = this._store.state.pointerY;
|
|
168
167
|
selectedObjects.forEach(selectedObject => {
|
|
@@ -640,59 +639,6 @@ class KritzelRotationHandler extends KritzelBaseHandler {
|
|
|
640
639
|
}
|
|
641
640
|
}
|
|
642
641
|
|
|
643
|
-
class KritzelGeometryHelper {
|
|
644
|
-
static doPolygonsIntersect(polygon1, polygon2) {
|
|
645
|
-
// 1. Convert polygons to array of points for easier processing
|
|
646
|
-
const points1 = [polygon1.bottomLeft, polygon1.bottomRight, polygon1.topRight, polygon1.topLeft];
|
|
647
|
-
const points2 = [polygon2.bottomLeft, polygon2.bottomRight, polygon2.topRight, polygon2.topLeft];
|
|
648
|
-
// 2. Check if any point of polygon1 is inside polygon2
|
|
649
|
-
for (const point of points1) {
|
|
650
|
-
if (this.isPointInPolygon(point, points2)) {
|
|
651
|
-
return true;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
// 3. Check if any point of polygon2 is inside polygon1
|
|
655
|
-
for (const point of points2) {
|
|
656
|
-
if (this.isPointInPolygon(point, points1)) {
|
|
657
|
-
return true;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
// 4. Check for edge intersections (more complex)
|
|
661
|
-
for (let i = 0; i < points1.length; i++) {
|
|
662
|
-
const p1a = points1[i];
|
|
663
|
-
const p1b = points1[(i + 1) % points1.length]; // Wrap around to the first point
|
|
664
|
-
for (let j = 0; j < points2.length; j++) {
|
|
665
|
-
const p2a = points2[j];
|
|
666
|
-
const p2b = points2[(j + 1) % points2.length];
|
|
667
|
-
if (this.intersectLines(p1a, p1b, p2a, p2b)) {
|
|
668
|
-
return true;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
return false; // No intersection found
|
|
673
|
-
}
|
|
674
|
-
static isPointInPolygon(point, polygon) {
|
|
675
|
-
let inside = false;
|
|
676
|
-
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
677
|
-
const xi = polygon[i].x, yi = polygon[i].y;
|
|
678
|
-
const xj = polygon[j].x, yj = polygon[j].y;
|
|
679
|
-
const intersect = yi > point.y !== yj > point.y && point.x < ((xj - xi) * (point.y - yi)) / (yj - yi) + xi;
|
|
680
|
-
if (intersect)
|
|
681
|
-
inside = !inside;
|
|
682
|
-
}
|
|
683
|
-
return inside;
|
|
684
|
-
}
|
|
685
|
-
static intersectLines(p1a, p1b, p2a, p2b) {
|
|
686
|
-
const det = (p1b.x - p1a.x) * (p2b.y - p2a.y) - (p1b.y - p1a.y) * (p2b.x - p2a.x);
|
|
687
|
-
if (det === 0) {
|
|
688
|
-
return false; // Lines are parallel
|
|
689
|
-
}
|
|
690
|
-
const t = ((p2a.x - p1a.x) * (p2b.y - p2a.y) - (p2a.y - p1a.y) * (p2b.x - p2a.x)) / det;
|
|
691
|
-
const u = -((p1a.x - p2a.x) * (p1b.y - p1a.y) - (p1a.y - p2a.y) * (p1b.x - p1a.x)) / det;
|
|
692
|
-
return t >= 0 && t <= 1 && u >= 0 && u <= 1;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
|
|
696
642
|
class KrtizelSelectionBox extends KritzelBaseObject {
|
|
697
643
|
constructor() {
|
|
698
644
|
super(...arguments);
|
|
@@ -705,8 +651,8 @@ class KrtizelSelectionBox extends KritzelBaseObject {
|
|
|
705
651
|
object.id = object.generateId();
|
|
706
652
|
object.scale = store.state.scale;
|
|
707
653
|
object.zIndex = 99999;
|
|
708
|
-
object.backgroundColor = 'var(--kritzel-selection-box-background-color, rgba(
|
|
709
|
-
object.borderColor = 'var(--kritzel-selection-box-border-color, rgba(
|
|
654
|
+
object.backgroundColor = 'var(--kritzel-selection-box-background-color, rgba(0, 122, 255, 0.2))';
|
|
655
|
+
object.borderColor = 'var(--kritzel-selection-box-border-color, rgba(0, 122, 255, 0.5))';
|
|
710
656
|
object.borderWidth = 2;
|
|
711
657
|
object.height = 0;
|
|
712
658
|
object.width = 0;
|
|
@@ -783,8 +729,10 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
783
729
|
if (event.pointerType === 'mouse') {
|
|
784
730
|
if (KritzelEventHelper.isLeftClick(event) && this._store.state.isSelecting) {
|
|
785
731
|
if (this.isSelectionClick) {
|
|
786
|
-
this.
|
|
787
|
-
this.
|
|
732
|
+
const x = this._store.state.pointerX;
|
|
733
|
+
const y = this._store.state.pointerY;
|
|
734
|
+
const selectedObject = this._store.getObjectsFromPointerEvent(event, '.object').find(obj => obj.hitTest(x, y));
|
|
735
|
+
this.addObjectToSelectionGroup(selectedObject);
|
|
788
736
|
this.removeSelectionBox();
|
|
789
737
|
}
|
|
790
738
|
if (this.isSelectionDrag) {
|
|
@@ -798,8 +746,10 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
798
746
|
clearTimeout(this.touchStartTimeout);
|
|
799
747
|
if (this._store.state.isSelecting) {
|
|
800
748
|
if (this.isSelectionClick) {
|
|
801
|
-
this.
|
|
802
|
-
this.
|
|
749
|
+
const x = this._store.state.pointerX;
|
|
750
|
+
const y = this._store.state.pointerY;
|
|
751
|
+
const selectedObject = this._store.getObjectsFromPointerEvent(event, '.object').find(obj => obj.hitTest(x, y));
|
|
752
|
+
this.addObjectToSelectionGroup(selectedObject);
|
|
803
753
|
this.removeSelectionBox();
|
|
804
754
|
}
|
|
805
755
|
if (this.isSelectionDrag) {
|
|
@@ -893,23 +843,16 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
893
843
|
updateSelectedObjects() {
|
|
894
844
|
this._store.allObjects
|
|
895
845
|
.filter(o => !(o instanceof KrtizelSelectionBox))
|
|
896
|
-
.forEach(object =>
|
|
897
|
-
const objectPolygon = object.rotatedPolygon;
|
|
898
|
-
const selectionBoxPolygon = this._store.state.selectionBox.rotatedPolygon;
|
|
899
|
-
object.isSelected = KritzelGeometryHelper.doPolygonsIntersect(objectPolygon, selectionBoxPolygon);
|
|
900
|
-
});
|
|
846
|
+
.forEach(object => (object.isSelected = object.hitTestPolygon(this._store.state.selectionBox.rotatedPolygon)));
|
|
901
847
|
}
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const selectedObject = selectedObjects[index];
|
|
905
|
-
if (!selectedObject) {
|
|
848
|
+
addObjectToSelectionGroup(object) {
|
|
849
|
+
if (!object) {
|
|
906
850
|
return;
|
|
907
851
|
}
|
|
908
|
-
selectedObjects.forEach(o => (o.isSelected = false));
|
|
909
852
|
this._store.state.selectionGroup = KritzelSelectionGroup.create(this._store);
|
|
910
|
-
this._store.state.selectionGroup.addOrRemove(
|
|
853
|
+
this._store.state.selectionGroup.addOrRemove(object);
|
|
911
854
|
this._store.state.selectionGroup.isSelected = true;
|
|
912
|
-
this._store.state.selectionGroup.rotation =
|
|
855
|
+
this._store.state.selectionGroup.rotation = object.rotation;
|
|
913
856
|
this._store.history.executeCommand(new AddSelectionGroupCommand(this._store, this, this._store.state.selectionGroup));
|
|
914
857
|
}
|
|
915
858
|
addSelectedObjectsToSelectionGroup() {
|
|
@@ -930,11 +873,31 @@ class KritzelSelectionHandler extends KritzelBaseHandler {
|
|
|
930
873
|
}
|
|
931
874
|
}
|
|
932
875
|
|
|
876
|
+
class KritzelHoverHandler extends KritzelBaseHandler {
|
|
877
|
+
constructor(store) {
|
|
878
|
+
super(store);
|
|
879
|
+
}
|
|
880
|
+
handlePointerMove(event) {
|
|
881
|
+
if (event.pointerType === 'mouse') {
|
|
882
|
+
const hoveredObject = this._store.getObjectFromPointerEvent(event, '.object');
|
|
883
|
+
if (!hoveredObject)
|
|
884
|
+
return;
|
|
885
|
+
const x = this._store.state.pointerX;
|
|
886
|
+
const y = this._store.state.pointerY;
|
|
887
|
+
hoveredObject.isHovered = hoveredObject.hitTest(x, y);
|
|
888
|
+
if (hoveredObject.isHovered) {
|
|
889
|
+
console.log(hoveredObject.id);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
933
895
|
class KritzelSelectionTool extends KritzelBaseTool {
|
|
934
896
|
constructor(store) {
|
|
935
897
|
super(store);
|
|
936
898
|
this.selectionHandler = new KritzelSelectionHandler(this._store);
|
|
937
899
|
this.moveHandler = new KritzelMoveHandler(this._store);
|
|
900
|
+
this.hoverHandler = new KritzelHoverHandler(this._store);
|
|
938
901
|
this.resizeHandler = new KritzelResizeHandler(this._store);
|
|
939
902
|
this.rotationHandler = new KritzelRotationHandler(this._store);
|
|
940
903
|
}
|
|
@@ -997,6 +960,7 @@ class KritzelSelectionTool extends KritzelBaseTool {
|
|
|
997
960
|
}
|
|
998
961
|
if (event.pointerType === 'mouse') {
|
|
999
962
|
this.moveHandler.handlePointerMove(event);
|
|
963
|
+
this.hoverHandler.handlePointerMove(event);
|
|
1000
964
|
this.selectionHandler.handlePointerMove(event);
|
|
1001
965
|
this.resizeHandler.handlePointerMove(event);
|
|
1002
966
|
this.rotationHandler.handlePointerMove(event);
|
|
@@ -1190,6 +1154,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
1190
1154
|
this.objects.forEach(obj => {
|
|
1191
1155
|
obj.translateX += deltaX;
|
|
1192
1156
|
obj.translateY += deltaY;
|
|
1157
|
+
obj.move(startX, startY, endX, endY);
|
|
1193
1158
|
this._store.state.objectsOctree.update(obj);
|
|
1194
1159
|
});
|
|
1195
1160
|
this.unchangedObjects.forEach(obj => {
|
|
@@ -1228,7 +1193,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
1228
1193
|
const rotatedY = sin * offsetX + cos * offsetY;
|
|
1229
1194
|
child.translateX = centerX + rotatedX - child.totalWidth / 2 / child.scale;
|
|
1230
1195
|
child.translateY = centerY + rotatedY - child.totalHeight / 2 / child.scale;
|
|
1231
|
-
child.
|
|
1196
|
+
child.rotate(this.objects.length === 1 ? value : value + unchangedChild.rotation);
|
|
1232
1197
|
this._store.state.objectsOctree.update(child);
|
|
1233
1198
|
});
|
|
1234
1199
|
}
|
|
@@ -2618,19 +2583,19 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
2618
2583
|
width: '100%',
|
|
2619
2584
|
height: '100%',
|
|
2620
2585
|
} }))), h("line", { x1: "0", y1: "0", x2: object.totalWidth, y2: "0", style: {
|
|
2621
|
-
stroke: 'var(--kritzel-selection-border-color, #
|
|
2586
|
+
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
2622
2587
|
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${(_b = this.store.state) === null || _b === void 0 ? void 0 : _b.scale})`,
|
|
2623
2588
|
strokeLinecap: 'square',
|
|
2624
2589
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: "0", y1: "0", x2: "0", y2: object.totalHeight, style: {
|
|
2625
|
-
stroke: 'var(--kritzel-selection-border-color, #
|
|
2590
|
+
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
2626
2591
|
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${(_c = this.store.state) === null || _c === void 0 ? void 0 : _c.scale})`,
|
|
2627
2592
|
strokeLinecap: 'square',
|
|
2628
2593
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: "0", y1: object.totalHeight, x2: object.totalWidth, y2: object.totalHeight, style: {
|
|
2629
|
-
stroke: 'var(--kritzel-selection-border-color, #
|
|
2594
|
+
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
2630
2595
|
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${(_d = this.store.state) === null || _d === void 0 ? void 0 : _d.scale})`,
|
|
2631
2596
|
strokeLinecap: 'square',
|
|
2632
2597
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("line", { x1: object.totalWidth, y1: "0", x2: object.totalWidth, y2: object.totalHeight, style: {
|
|
2633
|
-
stroke: 'var(--kritzel-selection-border-color, #
|
|
2598
|
+
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
2634
2599
|
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${(_e = this.store.state) === null || _e === void 0 ? void 0 : _e.scale})`,
|
|
2635
2600
|
strokeLinecap: 'square',
|
|
2636
2601
|
}, visibility: object.isSelected ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle top-left", cx: "0", cy: "0", r: `${(baseHandleSize * object.scale) / ((_f = this.store.state) === null || _f === void 0 ? void 0 : _f.scale)}`, style: {
|
|
@@ -2650,15 +2615,15 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
2650
2615
|
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "resize-handle-overlay bottom-right", cx: object.totalWidth, cy: object.totalHeight, r: `${(baseHandleTouchSize * object.scale) / ((_o = this.store.state) === null || _o === void 0 ? void 0 : _o.scale)}`, style: {
|
|
2651
2616
|
fill: 'transparent',
|
|
2652
2617
|
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("line", { x1: object.totalWidth / 2, y1: "0", x2: object.totalWidth / 2, y2: -((15 * object.scale) / ((_p = this.store.state) === null || _p === void 0 ? void 0 : _p.scale)), style: {
|
|
2653
|
-
stroke: 'var(--kritzel-selection-border-color, #
|
|
2618
|
+
stroke: 'var(--kritzel-selection-border-color, #007AFF)',
|
|
2654
2619
|
strokeWidth: `calc(var(--kritzel-selection-border-width, 2px) * ${object.scale} / ${(_q = this.store.state) === null || _q === void 0 ? void 0 : _q.scale})`,
|
|
2655
2620
|
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle", cx: object.totalWidth / 2, cy: -((15 * object.scale) / ((_r = this.store.state) === null || _r === void 0 ? void 0 : _r.scale)), r: `${(baseHandleSize * object.scale) / ((_s = this.store.state) === null || _s === void 0 ? void 0 : _s.scale)}`, style: {
|
|
2656
2621
|
fill: 'var(--kritzel-selection-handle-color, #000000)',
|
|
2657
2622
|
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("circle", { class: "rotation-handle-overlay", cx: object.totalWidth / 2, cy: -((15 * object.scale) / ((_t = this.store.state) === null || _t === void 0 ? void 0 : _t.scale)), r: `${(baseHandleTouchSize * object.scale) / ((_u = this.store.state) === null || _u === void 0 ? void 0 : _u.scale)}`, style: {
|
|
2658
2623
|
fill: 'transparent',
|
|
2659
2624
|
cursor: 'grab',
|
|
2660
|
-
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation)))))));
|
|
2661
|
-
}), h("svg", { key: '
|
|
2625
|
+
}, visibility: object.isSelected && !this.isSelecting ? 'visible' : 'hidden' }), h("g", { style: { display: this.store.state.debugInfo.showObjectInfo ? 'block' : 'none', pointerEvents: 'none' } }, h("foreignObject", { x: object.totalWidth.toString(), y: "0", width: "400px", height: "160px", style: { minHeight: '0', minWidth: '0', display: object.isDebugInfoVisible ? 'block' : 'none' } }, h("div", { style: { width: '100%', height: '100%' } }, h("div", { style: { whiteSpace: 'nowrap' } }, "zIndex: ", object.zIndex), h("div", { style: { whiteSpace: 'nowrap' } }, "translateX: ", object.translateX), h("div", { style: { whiteSpace: 'nowrap' } }, "translateY: ", object.translateY), h("div", { style: { whiteSpace: 'nowrap' } }, "width: ", object.width), h("div", { style: { whiteSpace: 'nowrap' } }, "height: ", object.height), h("div", { style: { whiteSpace: 'nowrap' } }, "scale: ", object.scale), h("div", { style: { whiteSpace: 'nowrap' } }, "rotation: ", object.rotation), h("div", { style: { whiteSpace: 'nowrap' } }, "x: ", object.x), h("div", { style: { whiteSpace: 'nowrap' } }, "y: ", object.y)))))));
|
|
2626
|
+
}), h("svg", { key: 'c40c470ce1a341a6d238ea6c313bd3a78465dbd9', class: "object", xmlns: "http://www.w3.org/2000/svg", style: {
|
|
2662
2627
|
height: (_u = this.store.state.currentPath) === null || _u === void 0 ? void 0 : _u.height.toString(),
|
|
2663
2628
|
width: (_v = this.store.state.currentPath) === null || _v === void 0 ? void 0 : _v.width.toString(),
|
|
2664
2629
|
left: '0',
|
|
@@ -2668,7 +2633,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
2668
2633
|
transform: (_x = this.store.state.currentPath) === null || _x === void 0 ? void 0 : _x.transformationMatrix,
|
|
2669
2634
|
transformOrigin: 'top left',
|
|
2670
2635
|
overflow: 'visible',
|
|
2671
|
-
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: '
|
|
2636
|
+
}, viewBox: (_y = this.store.state.currentPath) === null || _y === void 0 ? void 0 : _y.viewBox }, h("path", { key: 'f2d62173bc61abf639e356520419b50c0493f34b', d: (_z = this.store.state.currentPath) === null || _z === void 0 ? void 0 : _z.d, fill: (_0 = this.store.state.currentPath) === null || _0 === void 0 ? void 0 : _0.fill, stroke: (_1 = this.store.state.currentPath) === null || _1 === void 0 ? void 0 : _1.stroke }))), this.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: 'ad36d2e5eb72e2cbca73c48ef8a4db6d3b6f7a64', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.store.state.contextMenuItems, objects: ((_2 = this.store.state.selectionGroup) === null || _2 === void 0 ? void 0 : _2.objects) || [], style: {
|
|
2672
2637
|
position: 'fixed',
|
|
2673
2638
|
left: `${this.store.state.contextMenuX}px`,
|
|
2674
2639
|
top: `${this.store.state.contextMenuY}px`,
|
|
@@ -2680,7 +2645,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
2680
2645
|
y: (-this.store.state.translateY + this.store.state.contextMenuY) / this.store.state.scale,
|
|
2681
2646
|
}, (_a = this.store.state.selectionGroup) === null || _a === void 0 ? void 0 : _a.objects);
|
|
2682
2647
|
this.hideContextMenu();
|
|
2683
|
-
} })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '
|
|
2648
|
+
} })), ((_3 = this.store.state) === null || _3 === void 0 ? void 0 : _3.activeTool) instanceof KritzelEraserTool && !this.store.state.isScaling && h("kritzel-cursor-trail", { key: '6917e2621b4de0b0985e58a6043898d79e367ccc', store: this.store })));
|
|
2684
2649
|
}
|
|
2685
2650
|
get host() { return this; }
|
|
2686
2651
|
static get watchers() { return {
|
|
@@ -2754,6 +2719,6 @@ function defineCustomElement() {
|
|
|
2754
2719
|
}
|
|
2755
2720
|
|
|
2756
2721
|
export { ABSOLUTE_SCALE_MAX as A, KritzelImage as K, KritzelEraserTool as a, KritzelImageTool as b, KritzelSelectionTool as c, KritzelEngine as d, defineCustomElement as e, ABSOLUTE_SCALE_MIN as f };
|
|
2757
|
-
//# sourceMappingURL=p-
|
|
2722
|
+
//# sourceMappingURL=p-DJaVT2yR.js.map
|
|
2758
2723
|
|
|
2759
|
-
//# sourceMappingURL=p-
|
|
2724
|
+
//# sourceMappingURL=p-DJaVT2yR.js.map
|