@tldraw/editor 5.5.0-canary.c4ee38fb6d3c → 5.5.0-canary.c8596b8dd992
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.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +11 -2
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/shared/resizeBox.js +21 -16
- package/dist-cjs/lib/editor/shapes/shared/resizeBox.js.map +2 -2
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js +12 -5
- package/dist-cjs/lib/utils/sync/TLLocalSyncClient.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +13 -3
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/shared/resizeBox.mjs +21 -16
- package/dist-esm/lib/editor/shapes/shared/resizeBox.mjs.map +2 -2
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs +13 -6
- package/dist-esm/lib/utils/sync/TLLocalSyncClient.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +30 -6
- package/src/lib/editor/shapes/shared/resizeBox.ts +21 -16
- package/src/lib/utils/sync/TLLocalSyncClient.test.ts +73 -0
- package/src/lib/utils/sync/TLLocalSyncClient.ts +24 -8
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
392
392
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
393
393
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
394
394
|
"@tldraw/editor",
|
|
395
|
-
"5.5.0-canary.
|
|
395
|
+
"5.5.0-canary.c8596b8dd992",
|
|
396
396
|
"cjs"
|
|
397
397
|
);
|
|
398
398
|
//# sourceMappingURL=index.js.map
|
|
@@ -6030,11 +6030,20 @@ class Editor extends import_eventemitter3.default {
|
|
|
6030
6030
|
initialShape: options.initialShape,
|
|
6031
6031
|
initialBounds: options.initialBounds,
|
|
6032
6032
|
isAspectRatioLocked: options.isAspectRatioLocked,
|
|
6033
|
-
initialPageTransform: options.initialPageTransform
|
|
6033
|
+
initialPageTransform: options.initialPageTransform,
|
|
6034
|
+
dragHandle: options.dragHandle,
|
|
6035
|
+
mode: options.mode,
|
|
6036
|
+
// this is one frame of the same resize, not a new one, so don't fire start/end again
|
|
6037
|
+
skipStartAndEndCallbacks: options.skipStartAndEndCallbacks
|
|
6034
6038
|
});
|
|
6035
6039
|
if (Math.sign(scale.x) * Math.sign(scale.y) < 0) {
|
|
6036
6040
|
const parentRotation = this.getShapeParentTransform(id).rotation();
|
|
6037
|
-
const
|
|
6041
|
+
const parentDelta = (0, import_utils2.shortAngleDist)(
|
|
6042
|
+
import_Mat.Mat.Cast(options.initialPageTransform).rotation() - options.initialShape.rotation,
|
|
6043
|
+
parentRotation
|
|
6044
|
+
);
|
|
6045
|
+
const initialParentRotation = parentRotation - parentDelta;
|
|
6046
|
+
const rotation = 2 * options.scaleAxisRotation - options.initialShape.rotation - 2 * initialParentRotation - parentDelta;
|
|
6038
6047
|
this.updateShapes([{ id, type, rotation }]);
|
|
6039
6048
|
}
|
|
6040
6049
|
const preScaleShapePageCenter = import_Mat.Mat.applyToPoint(
|