@tldraw/editor 5.3.0-canary.c1b0b7574979 → 5.3.0-canary.da7dc7ee3db8
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 +15 -1
- package/dist-cjs/lib/editor/Editor.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 +15 -1
- package/dist-esm/lib/editor/Editor.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 +19 -4
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -379,7 +379,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
379
379
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
380
380
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
381
381
|
"@tldraw/editor",
|
|
382
|
-
"5.3.0-canary.
|
|
382
|
+
"5.3.0-canary.da7dc7ee3db8",
|
|
383
383
|
"cjs"
|
|
384
384
|
);
|
|
385
385
|
//# sourceMappingURL=index.js.map
|
|
@@ -4243,7 +4243,21 @@ class Editor extends import_eventemitter3.default {
|
|
|
4243
4243
|
*/
|
|
4244
4244
|
getSelectedShapeAtPoint(point) {
|
|
4245
4245
|
const selectedShapeIds = this.getSelectedShapeIds();
|
|
4246
|
-
|
|
4246
|
+
const margin = this.options.hitTestMargin / this.getZoomLevel();
|
|
4247
|
+
const sortedShapes = this.getCurrentPageShapesSorted();
|
|
4248
|
+
for (let i = sortedShapes.length - 1; i >= 0; i--) {
|
|
4249
|
+
const shape = sortedShapes[i];
|
|
4250
|
+
if (shape.type === "group") continue;
|
|
4251
|
+
if (!selectedShapeIds.includes(shape.id)) continue;
|
|
4252
|
+
if (this.getShapeGeometry(shape).hitTestPoint(
|
|
4253
|
+
this.getPointInShapeSpace(shape, point),
|
|
4254
|
+
margin,
|
|
4255
|
+
true
|
|
4256
|
+
)) {
|
|
4257
|
+
return shape;
|
|
4258
|
+
}
|
|
4259
|
+
}
|
|
4260
|
+
return void 0;
|
|
4247
4261
|
}
|
|
4248
4262
|
/**
|
|
4249
4263
|
* Get the shape at the current point.
|