kritzel-stencil 0.0.158 → 0.0.160
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/{default-text-tool.config-BySzvIox.js → default-text-tool.config-D10FksvZ.js} +139 -50
- package/dist/cjs/default-text-tool.config-D10FksvZ.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/kritzel-color_22.cjs.entry.js +4 -21
- package/dist/collection/classes/handlers/resize.handler.js +46 -32
- package/dist/collection/classes/handlers/resize.handler.js.map +1 -1
- package/dist/collection/classes/objects/selection-group.class.js +91 -16
- package/dist/collection/classes/objects/selection-group.class.js.map +1 -1
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +3 -20
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js.map +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/kritzel-editor.js +1 -1
- package/dist/components/kritzel-engine.js +1 -1
- package/dist/components/{p-DjTEcPMZ.js → p-DTHqEUDc.js} +142 -70
- package/dist/components/p-DTHqEUDc.js.map +1 -0
- package/dist/esm/{default-text-tool.config-2YFQA3SF.js → default-text-tool.config-DzqpOikl.js} +139 -50
- package/dist/esm/default-text-tool.config-DzqpOikl.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/kritzel-color_22.entry.js +4 -21
- package/dist/stencil/index.esm.js +1 -1
- package/dist/stencil/{p-14102a0c.entry.js → p-5475442e.entry.js} +3 -3
- package/dist/stencil/p-5475442e.entry.js.map +1 -0
- package/dist/stencil/{p-2YFQA3SF.js → p-DzqpOikl.js} +2 -2
- package/dist/stencil/p-DzqpOikl.js.map +1 -0
- package/dist/stencil/stencil.esm.js +1 -1
- package/dist/types/classes/objects/selection-group.class.d.ts +1 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/default-text-tool.config-BySzvIox.js.map +0 -1
- package/dist/components/p-DjTEcPMZ.js.map +0 -1
- package/dist/esm/default-text-tool.config-2YFQA3SF.js.map +0 -1
- package/dist/stencil/p-14102a0c.entry.js.map +0 -1
- package/dist/stencil/p-2YFQA3SF.js.map +0 -1
|
@@ -471,32 +471,42 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
471
471
|
if (!this.hasResized) {
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
+
const rotation = selectionGroup.rotation;
|
|
475
|
+
const sin = Math.sin(rotation);
|
|
476
|
+
const cos = Math.cos(rotation);
|
|
477
|
+
const activeScale = selectionGroup.scale || this._core.store.state.scale;
|
|
478
|
+
// Calculate delta in local unrotated space
|
|
479
|
+
// We rotate the screen delta by -rotation to align with the object's axes
|
|
480
|
+
const localDx = dx * cos + dy * sin;
|
|
481
|
+
const localDy = -dx * sin + dy * cos;
|
|
482
|
+
// Calculate the center of the selection group before resize
|
|
483
|
+
const initialCenterX = this.initialSize.x + this.initialSize.width / activeScale / 2;
|
|
484
|
+
const initialCenterY = this.initialSize.y + this.initialSize.height / activeScale / 2;
|
|
485
|
+
// The center moves by half of the screen delta (scaled)
|
|
486
|
+
// This is true regardless of rotation because the resize happens symmetrically around the center
|
|
487
|
+
// relative to the fixed point logic
|
|
488
|
+
const newCenterX = initialCenterX + dx / activeScale / 2;
|
|
489
|
+
const newCenterY = initialCenterY + dy / activeScale / 2;
|
|
474
490
|
switch (this._core.store.state.resizeHandleType) {
|
|
475
491
|
case KritzelHandleType.TopLeft:
|
|
476
|
-
this.newSize.width = this.initialSize.width -
|
|
477
|
-
this.newSize.height = this.initialSize.height -
|
|
478
|
-
this.newSize.x = dx / this._core.store.state.scale + this.initialSize.x;
|
|
479
|
-
this.newSize.y = dy / this._core.store.state.scale + this.initialSize.y;
|
|
492
|
+
this.newSize.width = this.initialSize.width - localDx;
|
|
493
|
+
this.newSize.height = this.initialSize.height - localDy;
|
|
480
494
|
break;
|
|
481
495
|
case KritzelHandleType.TopRight:
|
|
482
|
-
this.newSize.width = this.initialSize.width +
|
|
483
|
-
this.newSize.height = this.initialSize.height -
|
|
484
|
-
this.newSize.x = this.initialSize.x;
|
|
485
|
-
this.newSize.y = dy / this._core.store.state.scale + this.initialSize.y;
|
|
496
|
+
this.newSize.width = this.initialSize.width + localDx;
|
|
497
|
+
this.newSize.height = this.initialSize.height - localDy;
|
|
486
498
|
break;
|
|
487
499
|
case KritzelHandleType.BottomLeft:
|
|
488
|
-
this.newSize.width = this.initialSize.width -
|
|
489
|
-
this.newSize.height = this.initialSize.height +
|
|
490
|
-
this.newSize.x = dx / this._core.store.state.scale + this.initialSize.x;
|
|
491
|
-
this.newSize.y = this.initialSize.y;
|
|
500
|
+
this.newSize.width = this.initialSize.width - localDx;
|
|
501
|
+
this.newSize.height = this.initialSize.height + localDy;
|
|
492
502
|
break;
|
|
493
503
|
case KritzelHandleType.BottomRight:
|
|
494
|
-
this.newSize.width = this.initialSize.width +
|
|
495
|
-
this.newSize.height = this.initialSize.height +
|
|
496
|
-
this.newSize.x = this.initialSize.x;
|
|
497
|
-
this.newSize.y = this.initialSize.y;
|
|
504
|
+
this.newSize.width = this.initialSize.width + localDx;
|
|
505
|
+
this.newSize.height = this.initialSize.height + localDy;
|
|
498
506
|
break;
|
|
499
507
|
}
|
|
508
|
+
this.newSize.x = newCenterX - this.newSize.width / activeScale / 2;
|
|
509
|
+
this.newSize.y = newCenterY - this.newSize.height / activeScale / 2;
|
|
500
510
|
selectionGroup.resize(this.newSize.x, this.newSize.y, this.newSize.width, this.newSize.height);
|
|
501
511
|
}
|
|
502
512
|
}
|
|
@@ -522,32 +532,36 @@ class KritzelResizeHandler extends KritzelBaseHandler {
|
|
|
522
532
|
if (!this.hasResized) {
|
|
523
533
|
return;
|
|
524
534
|
}
|
|
535
|
+
const rotation = selectionGroup.rotation;
|
|
536
|
+
const sin = Math.sin(rotation);
|
|
537
|
+
const cos = Math.cos(rotation);
|
|
538
|
+
const activeScale = selectionGroup.scale || this._core.store.state.scale;
|
|
539
|
+
const localDx = dx * cos + dy * sin;
|
|
540
|
+
const localDy = -dx * sin + dy * cos;
|
|
541
|
+
const initialCenterX = this.initialSize.x + this.initialSize.width / activeScale / 2;
|
|
542
|
+
const initialCenterY = this.initialSize.y + this.initialSize.height / activeScale / 2;
|
|
543
|
+
const newCenterX = initialCenterX + dx / activeScale / 2;
|
|
544
|
+
const newCenterY = initialCenterY + dy / activeScale / 2;
|
|
525
545
|
switch (this._core.store.state.resizeHandleType) {
|
|
526
546
|
case KritzelHandleType.TopLeft:
|
|
527
|
-
this.newSize.width = this.initialSize.width -
|
|
528
|
-
this.newSize.height = this.initialSize.height -
|
|
529
|
-
this.newSize.x = dx / this._core.store.state.scale + this.initialSize.x;
|
|
530
|
-
this.newSize.y = dy / this._core.store.state.scale + this.initialSize.y;
|
|
547
|
+
this.newSize.width = this.initialSize.width - localDx;
|
|
548
|
+
this.newSize.height = this.initialSize.height - localDy;
|
|
531
549
|
break;
|
|
532
550
|
case KritzelHandleType.TopRight:
|
|
533
|
-
this.newSize.width = this.initialSize.width +
|
|
534
|
-
this.newSize.height = this.initialSize.height -
|
|
535
|
-
this.newSize.x = this.initialSize.x;
|
|
536
|
-
this.newSize.y = dy / this._core.store.state.scale + this.initialSize.y;
|
|
551
|
+
this.newSize.width = this.initialSize.width + localDx;
|
|
552
|
+
this.newSize.height = this.initialSize.height - localDy;
|
|
537
553
|
break;
|
|
538
554
|
case KritzelHandleType.BottomLeft:
|
|
539
|
-
this.newSize.width = this.initialSize.width -
|
|
540
|
-
this.newSize.height = this.initialSize.height +
|
|
541
|
-
this.newSize.x = dx / this._core.store.state.scale + this.initialSize.x;
|
|
542
|
-
this.newSize.y = this.initialSize.y;
|
|
555
|
+
this.newSize.width = this.initialSize.width - localDx;
|
|
556
|
+
this.newSize.height = this.initialSize.height + localDy;
|
|
543
557
|
break;
|
|
544
558
|
case KritzelHandleType.BottomRight:
|
|
545
|
-
this.newSize.width = this.initialSize.width +
|
|
546
|
-
this.newSize.height = this.initialSize.height +
|
|
547
|
-
this.newSize.x = this.initialSize.x;
|
|
548
|
-
this.newSize.y = this.initialSize.y;
|
|
559
|
+
this.newSize.width = this.initialSize.width + localDx;
|
|
560
|
+
this.newSize.height = this.initialSize.height + localDy;
|
|
549
561
|
break;
|
|
550
562
|
}
|
|
563
|
+
this.newSize.x = newCenterX - this.newSize.width / activeScale / 2;
|
|
564
|
+
this.newSize.y = newCenterY - this.newSize.height / activeScale / 2;
|
|
551
565
|
selectionGroup.resize(this.newSize.x, this.newSize.y, this.newSize.width, this.newSize.height);
|
|
552
566
|
}
|
|
553
567
|
}
|
|
@@ -717,6 +731,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
717
731
|
objectIds = [];
|
|
718
732
|
// Store snapshots of object state for transformations (rotation, resize)
|
|
719
733
|
unchangedObjectSnapshots = new Map();
|
|
734
|
+
snapshotRotation = 0;
|
|
720
735
|
minX;
|
|
721
736
|
maxX;
|
|
722
737
|
minY;
|
|
@@ -787,6 +802,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
787
802
|
*/
|
|
788
803
|
captureUnchangedSnapshots() {
|
|
789
804
|
this.unchangedObjectSnapshots.clear();
|
|
805
|
+
this.snapshotRotation = this.rotation;
|
|
790
806
|
this.objects.forEach(obj => {
|
|
791
807
|
this.unchangedObjectSnapshots.set(obj.id, {
|
|
792
808
|
id: obj.id,
|
|
@@ -846,14 +862,56 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
846
862
|
resize(x, y, width, height) {
|
|
847
863
|
const widthScaleFactor = width / this.width;
|
|
848
864
|
const heightScaleFactor = height / this.height;
|
|
849
|
-
|
|
850
|
-
const
|
|
865
|
+
// Calculate old center
|
|
866
|
+
const oldCenterX = this.translateX + this.totalWidth / 2 / this.scale;
|
|
867
|
+
const oldCenterY = this.translateY + this.totalHeight / 2 / this.scale;
|
|
868
|
+
// Calculate new center
|
|
869
|
+
const newTotalWidth = width + this.padding * 2;
|
|
870
|
+
const newTotalHeight = height + this.padding * 2;
|
|
871
|
+
const newCenterX = x + newTotalWidth / 2 / this.scale;
|
|
872
|
+
const newCenterY = y + newTotalHeight / 2 / this.scale;
|
|
873
|
+
const rotation = this.rotation;
|
|
874
|
+
const cos = Math.cos(-rotation);
|
|
875
|
+
const sin = Math.sin(-rotation);
|
|
876
|
+
const cosR = Math.cos(rotation);
|
|
877
|
+
const sinR = Math.sin(rotation);
|
|
851
878
|
this._core.store.state.objects.transaction(() => {
|
|
852
879
|
this.objects.forEach(child => {
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
const
|
|
856
|
-
|
|
880
|
+
// Calculate child center
|
|
881
|
+
const childCenterX = child.translateX + child.totalWidth / 2 / child.scale;
|
|
882
|
+
const childCenterY = child.translateY + child.totalHeight / 2 / child.scale;
|
|
883
|
+
// Vector from old group center to child center
|
|
884
|
+
const dx = childCenterX - oldCenterX;
|
|
885
|
+
const dy = childCenterY - oldCenterY;
|
|
886
|
+
// Rotate to local space (align with group axes)
|
|
887
|
+
const localX = dx * cos - dy * sin;
|
|
888
|
+
const localY = dx * sin + dy * cos;
|
|
889
|
+
// Scale in local space
|
|
890
|
+
const scaledLocalX = localX * widthScaleFactor;
|
|
891
|
+
const scaledLocalY = localY * heightScaleFactor;
|
|
892
|
+
// Rotate back to world space
|
|
893
|
+
const rotatedX = scaledLocalX * cosR - scaledLocalY * sinR;
|
|
894
|
+
const rotatedY = scaledLocalX * sinR + scaledLocalY * cosR;
|
|
895
|
+
// New child center
|
|
896
|
+
const newChildCenterX = newCenterX + rotatedX;
|
|
897
|
+
const newChildCenterY = newCenterY + rotatedY;
|
|
898
|
+
// New child top-left
|
|
899
|
+
// Calculate relative rotation
|
|
900
|
+
const relativeRotation = child.rotation - rotation;
|
|
901
|
+
const cosRel = Math.cos(relativeRotation);
|
|
902
|
+
const sinRel = Math.sin(relativeRotation);
|
|
903
|
+
// Project the group's scale factors onto the child's local axes
|
|
904
|
+
// We use absolute values because scaling is magnitude-based
|
|
905
|
+
// If the child is aligned (0 deg), cos=1, sin=0 -> scales match
|
|
906
|
+
// If the child is 90 deg, cos=0, sin=1 -> scales swap
|
|
907
|
+
const newChildWidthScale = Math.sqrt(Math.pow(widthScaleFactor * cosRel, 2) + Math.pow(heightScaleFactor * sinRel, 2));
|
|
908
|
+
const newChildHeightScale = Math.sqrt(Math.pow(widthScaleFactor * sinRel, 2) + Math.pow(heightScaleFactor * cosRel, 2));
|
|
909
|
+
const updatedWidth = child.width * newChildWidthScale;
|
|
910
|
+
const updatedHeight = child.height * newChildHeightScale;
|
|
911
|
+
const updatedTotalWidth = updatedWidth + child.padding * 2;
|
|
912
|
+
const updatedTotalHeight = updatedHeight + child.padding * 2;
|
|
913
|
+
const updatedX = newChildCenterX - updatedTotalWidth / 2 / child.scale;
|
|
914
|
+
const updatedY = newChildCenterY - updatedTotalHeight / 2 / child.scale;
|
|
857
915
|
child.resize(updatedX, updatedY, updatedWidth, updatedHeight);
|
|
858
916
|
});
|
|
859
917
|
// Refresh dimensions and update the SelectionGroup to propagate changes to other tabs
|
|
@@ -866,7 +924,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
866
924
|
this.rotation = value;
|
|
867
925
|
const centerX = this.translateX + this.totalWidth / 2 / this.scale;
|
|
868
926
|
const centerY = this.translateY + this.totalHeight / 2 / this.scale;
|
|
869
|
-
const angle = value;
|
|
927
|
+
const angle = value - this.snapshotRotation;
|
|
870
928
|
const cos = Math.cos(angle);
|
|
871
929
|
const sin = Math.sin(angle);
|
|
872
930
|
this._core.store.state.objects.transaction(() => {
|
|
@@ -882,7 +940,7 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
882
940
|
const rotatedY = sin * offsetX + cos * offsetY;
|
|
883
941
|
child.translateX = centerX + rotatedX - child.totalWidth / 2 / child.scale;
|
|
884
942
|
child.translateY = centerY + rotatedY - child.totalHeight / 2 / child.scale;
|
|
885
|
-
child.rotate(this.objects.length === 1 ? value :
|
|
943
|
+
child.rotate(this.objects.length === 1 ? value : unchangedSnapshot.rotation + angle);
|
|
886
944
|
});
|
|
887
945
|
});
|
|
888
946
|
}
|
|
@@ -913,14 +971,45 @@ class KritzelSelectionGroup extends KritzelBaseObject {
|
|
|
913
971
|
this.height = (this.maxY - this.minY - this.padding) * this.scale;
|
|
914
972
|
}
|
|
915
973
|
else {
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
this.
|
|
974
|
+
const rotation = this.rotation;
|
|
975
|
+
const cos = Math.cos(-rotation);
|
|
976
|
+
const sin = Math.sin(-rotation);
|
|
977
|
+
let minX = Infinity;
|
|
978
|
+
let maxX = -Infinity;
|
|
979
|
+
let minY = Infinity;
|
|
980
|
+
let maxY = -Infinity;
|
|
981
|
+
this.objects.forEach(obj => {
|
|
982
|
+
const polygon = obj.rotatedPolygon;
|
|
983
|
+
const corners = [polygon.topLeft, polygon.topRight, polygon.bottomRight, polygon.bottomLeft];
|
|
984
|
+
corners.forEach(corner => {
|
|
985
|
+
// Rotate corner into local space (aligned with group rotation)
|
|
986
|
+
const rx = corner.x * cos - corner.y * sin;
|
|
987
|
+
const ry = corner.x * sin + corner.y * cos;
|
|
988
|
+
if (rx < minX)
|
|
989
|
+
minX = rx;
|
|
990
|
+
if (rx > maxX)
|
|
991
|
+
maxX = rx;
|
|
992
|
+
if (ry < minY)
|
|
993
|
+
minY = ry;
|
|
994
|
+
if (ry > maxY)
|
|
995
|
+
maxY = ry;
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
// Dimensions in world units (unrotated)
|
|
999
|
+
const worldWidth = maxX - minX;
|
|
1000
|
+
const worldHeight = maxY - minY;
|
|
1001
|
+
this.width = (worldWidth - this.padding) * this.scale;
|
|
1002
|
+
this.height = (worldHeight - this.padding) * this.scale;
|
|
1003
|
+
// Center of the box in rotated space
|
|
1004
|
+
const cRx = (minX + maxX) / 2;
|
|
1005
|
+
const cRy = (minY + maxY) / 2;
|
|
1006
|
+
// Rotate center back to world space
|
|
1007
|
+
const cosR = Math.cos(rotation);
|
|
1008
|
+
const sinR = Math.sin(rotation);
|
|
1009
|
+
const cx = cRx * cosR - cRy * sinR;
|
|
1010
|
+
const cy = cRx * sinR + cRy * cosR;
|
|
1011
|
+
this.translateX = cx - (this.width / this.scale + 2 * this.padding) / 2;
|
|
1012
|
+
this.translateY = cy - (this.height / this.scale + 2 * this.padding) / 2;
|
|
924
1013
|
}
|
|
925
1014
|
this._core.store.state.objects.update(this);
|
|
926
1015
|
}
|
|
@@ -35280,7 +35369,6 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
35280
35369
|
contextMenuHandler;
|
|
35281
35370
|
keyHandler;
|
|
35282
35371
|
contextMenuElement = null;
|
|
35283
|
-
visibleObjectsTimings = [];
|
|
35284
35372
|
get isSelecting() {
|
|
35285
35373
|
return this.core.store.state.activeTool instanceof KritzelSelectionTool && this.core.store.state.isSelecting;
|
|
35286
35374
|
}
|
|
@@ -35361,7 +35449,6 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
35361
35449
|
const baseHandleTouchSize = baseHandleSize * 2 < 14 ? 14 : baseHandleSize;
|
|
35362
35450
|
const viewportCenterX = this.core.store.state.viewportWidth / 2 + this.core.store.state.translateX;
|
|
35363
35451
|
const viewportCenterY = this.core.store.state.viewportHeight / 2 + this.core.store.state.translateY;
|
|
35364
|
-
const startTime = performance.now();
|
|
35365
35452
|
const viewportBounds = {
|
|
35366
35453
|
x: -this.core.store.state.translateX / this.core.store.state.scale,
|
|
35367
35454
|
y: -this.core.store.state.translateY / this.core.store.state.scale,
|
|
@@ -35371,22 +35458,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
35371
35458
|
depth: 100,
|
|
35372
35459
|
};
|
|
35373
35460
|
const visibleObjects = this.core.store.state.objects.query(viewportBounds);
|
|
35374
|
-
|
|
35375
|
-
const elapsed = endTime - startTime;
|
|
35376
|
-
this.visibleObjectsTimings.push(elapsed);
|
|
35377
|
-
if (this.visibleObjectsTimings.length > 25) {
|
|
35378
|
-
this.visibleObjectsTimings.shift();
|
|
35379
|
-
}
|
|
35380
|
-
if (this.visibleObjectsTimings.length === 25) {
|
|
35381
|
-
const avg = this.visibleObjectsTimings.reduce((a, b) => a + b, 0) / 25;
|
|
35382
|
-
const min = Math.min(...this.visibleObjectsTimings);
|
|
35383
|
-
const max = Math.max(...this.visibleObjectsTimings);
|
|
35384
|
-
console.log(`[Performance] Visible objects over 25 calls - Avg: ${avg.toFixed(2)}ms, Min: ${min.toFixed(2)}ms, Max: ${max.toFixed(2)}ms, Current: ${elapsed.toFixed(2)}ms (${visibleObjects.length} objects)`);
|
|
35385
|
-
}
|
|
35386
|
-
else {
|
|
35387
|
-
console.log(`[Performance] Getting visible objects took ${elapsed.toFixed(2)}ms (${visibleObjects.length} objects visible) [${this.visibleObjectsTimings.length}/25 samples]`);
|
|
35388
|
-
}
|
|
35389
|
-
return (h(Host, { key: 'f59e309c44cf9d056c17df5bae809227b0da6014' }, this.core.store.state.debugInfo.showViewportInfo && (h("div", { key: '2e22b7eb72f8eea9b7aafb5b54d82039931fb1dd', class: "debug-panel" }, h("div", { key: 'd003aff63c05fa5889ae73448c603e4461bdcb68' }, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), h("div", { key: '62c6c30e81f284904e159b8abbc643527cd760ee' }, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), h("div", { key: 'e6e80882c725104d52fab8da9a8b1f9e52c28202' }, "TranslateX: ", this.core.store.state?.translateX), h("div", { key: 'c88da5777f20f6b93f22cd78d624bd3673fa3fbd' }, "TranslateY: ", this.core.store.state?.translateY), h("div", { key: '19d293c9e537961dc0dd47ff138608eccc84b9c0' }, "ViewportWidth: ", this.core.store.state?.viewportWidth), h("div", { key: '747c1d0b46a918aafa8da3bff094d08b321ab638' }, "ViewportHeight: ", this.core.store.state?.viewportHeight), h("div", { key: 'a0a89524a87a8a5a438077c77c53c63bfbc02358' }, "PointerCount: ", this.core.store.state.pointers.size), h("div", { key: 'b4b385704c802a78cd959998cff0bf61dad6a54c' }, "Scale: ", this.core.store.state?.scale), h("div", { key: '8933716cedc4d45092e6810adb8fbad1a1c80af3' }, "ActiveTool: ", this.core.store.state?.activeTool?.name), h("div", { key: '407c5a3ca4b73e13f2f11e36b20792231e512e43' }, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), h("div", { key: '8c81eccee3d1b13ded8cb3e47a275df585cfb276' }, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), h("div", { key: '8af988839b1712024a692d554021c9a6b5c95ea1' }, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), h("div", { key: '6b29e356911a7f6a8b7ec349323974c0160c99a9' }, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), h("div", { key: 'd47293ba022498e1e91d3b44d668bb5b09120cc0' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '135e1930f98d56018367fb2653a4564b4b01ea5a' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: 'bccac5527134ed4eb2308c96a056bad7ad47b479' }, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '8a18e170e35f1a7cf889b6c9fcb44a2ea9b4b73e' }, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: '88e357566ef307d1c274a75994de95f1682497b4' }, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), h("div", { key: '48cefe71eb0c4676f9a708a6857500b68f5e5e6c' }, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), h("div", { key: '0646a93553cb9ca21f27c876314104efec7f7b4d' }, "PointerX: ", this.core.store.state?.pointerX), h("div", { key: '18cf01af3a33b87f26215921f8d67cae13743f68' }, "PointerY: ", this.core.store.state?.pointerY), h("div", { key: '3a250d4b06489eeea5a8765675bab0f1bad358ce' }, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), h("div", { key: 'c5f9bc07eb57de8de922efcf2646ace75fb48a7e' }, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), h("div", { key: '25d849d5d92785d0545fcd54d0d94bbf5713b6b4', id: "origin", class: "origin", style: {
|
|
35461
|
+
return (h(Host, { key: '1a76bcddde5f1aa68dd20a73af61f6f89ab08c78' }, this.core.store.state.debugInfo.showViewportInfo && (h("div", { key: '9be109e44187d7d2072e115533b3c58a36351993', class: "debug-panel" }, h("div", { key: 'de16ca51bc04f851ef65a9a937829916041abd1c' }, "ActiveWorkspaceId: ", this.core.store.state?.activeWorkspace?.id), h("div", { key: '299b05d4091d6c883ee637207e242e3fdb93f19c' }, "ActiveWorkspaceName: ", this.core.store.state?.activeWorkspace?.name), h("div", { key: '9ef3f04b7fcb42ec87d8b7e6b9f5e914918fd780' }, "TranslateX: ", this.core.store.state?.translateX), h("div", { key: 'cd920e869be5112c7dbe7d494f9fa06902c3d30a' }, "TranslateY: ", this.core.store.state?.translateY), h("div", { key: 'd8d28322f8cc2b5cf9a3da2c97c91e3115f53ddc' }, "ViewportWidth: ", this.core.store.state?.viewportWidth), h("div", { key: 'e8d920e10b020b359533682452f76489bc8e9f2d' }, "ViewportHeight: ", this.core.store.state?.viewportHeight), h("div", { key: '768280f7bf01703c9f6ea22b06b89fe7130006a4' }, "PointerCount: ", this.core.store.state.pointers.size), h("div", { key: 'ff0f5e860a9987abaf8c81b95d1476af19d9b186' }, "Scale: ", this.core.store.state?.scale), h("div", { key: 'a672fbf63576a1776f4d3960d9f36493a4308a79' }, "ActiveTool: ", this.core.store.state?.activeTool?.name), h("div", { key: 'd562bff5d582e3df38e0a62229c8c7b0700b9fa0' }, "HasViewportChanged: ", this.core.store.state?.hasViewportChanged ? 'true' : 'false'), h("div", { key: 'd6b2646e7fd0abb5d39928c51ad340ccf306db01' }, "IsEnabled: ", this.core.store.state?.isEnabled ? 'true' : 'false'), h("div", { key: '453e3d3691aad984895241734c70de61cbcd60ec' }, "IsScaling: ", this.core.store.state?.isScaling ? 'true' : 'false'), h("div", { key: '156668df87ea5001c7348c1c141f1c8601fe23da' }, "IsPanning: ", this.core.store.state?.isPanning ? 'true' : 'false'), h("div", { key: '86f956f35a84961c17685ebfd7cb73e92f04cd45' }, "IsSelecting: ", this.isSelecting ? 'true' : 'false'), h("div", { key: '73581c5791434983308d49e5c41f82836729a75d' }, "IsSelectionActive: ", this.isSelectionActive ? 'true' : 'false'), h("div", { key: '23f3eef374052545b7e99b0cb58a00011b421188' }, "IsResizeHandleSelected: ", this.core.store.state.isResizeHandleSelected ? 'true' : 'false'), h("div", { key: '51842e9f6e95413e6defbe6f81f43c1c7559be3e' }, "IsRotationHandleSelected: ", this.core.store.state.isRotationHandleSelected ? 'true' : 'false'), h("div", { key: 'b835c25cb75bc6f6d29a71ba25b18735f60319f8' }, "IsDrawing: ", this.core.store.state.isDrawing ? 'true' : 'false'), h("div", { key: '9a9740f44f06d57f2f9a1fce94ca2330a9c14e29' }, "IsWriting: ", this.core.store.state.isWriting ? 'true' : 'false'), h("div", { key: '9b97322077152d4fbcb98bc650ee7d0555f8d06d' }, "PointerX: ", this.core.store.state?.pointerX), h("div", { key: '9eddc79647458ca7b72e3241709fc36276587159' }, "PointerY: ", this.core.store.state?.pointerY), h("div", { key: '426ac2bf30669cc79beda5c2e5136eba5c29c578' }, "SelectedObjects: ", this.core.store.selectionGroup?.objects.length || 0), h("div", { key: '8544b6e8aaeacee60fe9597ec13af11c938eaacf' }, "ViewportCenter: (", viewportCenterX.toFixed(2), ", ", viewportCenterY.toFixed(2), ")"))), h("div", { key: '5101eecff40329a93b5ac6eb09830f1067ebaa90', id: "origin", class: "origin", style: {
|
|
35390
35462
|
transform: `matrix(${this.core.store.state?.scale}, 0, 0, ${this.core.store.state?.scale}, ${this.core.store.state?.translateX}, ${this.core.store.state?.translateY})`,
|
|
35391
35463
|
} }, visibleObjects?.map(object => {
|
|
35392
35464
|
return (h("div", { key: object.id, style: {
|
|
@@ -35513,7 +35585,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
35513
35585
|
cursor: 'grab',
|
|
35514
35586
|
paintOrder: 'fill',
|
|
35515
35587
|
} }))))));
|
|
35516
|
-
})), this.core.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '
|
|
35588
|
+
})), this.core.store.state.isContextMenuVisible && (h("kritzel-context-menu", { key: '8270193062df51aa5e358bd31c0851f54e4644d1', class: "context-menu", ref: el => (this.contextMenuElement = el), items: this.core.store.state.contextMenuItems, objects: this.core.store.selectionGroup?.objects || [], style: {
|
|
35517
35589
|
position: 'fixed',
|
|
35518
35590
|
left: `${this.core.store.state.contextMenuX}px`,
|
|
35519
35591
|
top: `${this.core.store.state.contextMenuY}px`,
|
|
@@ -35524,7 +35596,7 @@ const KritzelEngine = /*@__PURE__*/ proxyCustomElement(class KritzelEngine exten
|
|
|
35524
35596
|
y: (-this.core.store.state.translateY + this.core.store.state.contextMenuY) / this.core.store.state.scale,
|
|
35525
35597
|
}, this.core.store.selectionGroup?.objects);
|
|
35526
35598
|
this.hideContextMenu();
|
|
35527
|
-
}, onClose: () => this.hideContextMenu() })), this.core.store.state?.activeTool instanceof KritzelEraserTool && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { key: '
|
|
35599
|
+
}, onClose: () => this.hideContextMenu() })), this.core.store.state?.activeTool instanceof KritzelEraserTool && !this.core.store.state.isScaling && h("kritzel-cursor-trail", { key: '7d199fcf652dee0cd12fff8a558b455c361e019f', core: this.core })));
|
|
35528
35600
|
}
|
|
35529
35601
|
static get watchers() { return {
|
|
35530
35602
|
"workspace": ["onWorkspaceChange"],
|
|
@@ -35605,6 +35677,6 @@ function defineCustomElement() {
|
|
|
35605
35677
|
}
|
|
35606
35678
|
|
|
35607
35679
|
export { isNode as A, min$2 as B, pow as C, HocuspocusProviderWebsocket as D, KritzelEraserTool as E, KritzelImageTool as F, KritzelSelectionTool as G, HocuspocusProvider as H, IndexedDBSyncProvider as I, KritzelAppStateMap as J, KritzelImage as K, ABSOLUTE_SCALE_MAX as L, ABSOLUTE_SCALE_MIN as M, defineCustomElement as N, Observable$1 as O, KritzelEngine as P, writeVarUint8Array$2 as a, readVarUint8Array$2 as b, applyUpdate as c, encodeStateVector as d, encodeStateAsUpdate as e, createEncoder$1 as f, createDecoder$1 as g, create$8 as h, fromBase64 as i, toBase64 as j, createUint8ArrayFromArrayBuffer as k, offChange as l, readVarString$2 as m, floor$2 as n, onChange as o, getUnixTime$1 as p, equalityDeep$1 as q, readVarUint$2 as r, setIfUndefined$1 as s, toUint8Array$1 as t, writeVarString$2 as u, varStorage as v, writeVarUint$2 as w, map as x, ObservableV2 as y, length$3 as z };
|
|
35608
|
-
//# sourceMappingURL=p-
|
|
35680
|
+
//# sourceMappingURL=p-DTHqEUDc.js.map
|
|
35609
35681
|
|
|
35610
|
-
//# sourceMappingURL=p-
|
|
35682
|
+
//# sourceMappingURL=p-DTHqEUDc.js.map
|