@tldraw/editor 3.13.0-canary.8b94604b33ff → 3.13.0-canary.8f06b22abe77
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 +28 -0
- package/dist-cjs/lib/editor/Editor.js.map +3 -3
- 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 +28 -0
- package/dist-esm/lib/editor/Editor.mjs.map +3 -3
- 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 -0
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -7507,6 +7507,34 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
7507
7507
|
}
|
|
7508
7508
|
const { x: cx, y: cy, z: cz } = (0, import_state.unsafe__withoutCapture)(() => this.getCamera());
|
|
7509
7509
|
const { x: dx, y: dy, z: dz = 0 } = info.delta;
|
|
7510
|
+
if (this.inputs.keys.has("KeyV")) {
|
|
7511
|
+
const selectedShapeIds = this.getSelectedShapeIds();
|
|
7512
|
+
if (selectedShapeIds.length > 0) {
|
|
7513
|
+
const instanceState2 = this.getInstanceState();
|
|
7514
|
+
if (!instanceState2.isChangingStyle) {
|
|
7515
|
+
this.updateInstanceState({ isChangingStyle: true });
|
|
7516
|
+
}
|
|
7517
|
+
clearTimeout(this._isChangingStyleTimeout);
|
|
7518
|
+
this._isChangingStyleTimeout = this.timers.setTimeout(() => {
|
|
7519
|
+
this._updateInstanceState({ isChangingStyle: false }, { history: "ignore" });
|
|
7520
|
+
}, 1e3);
|
|
7521
|
+
this.updateShapes(
|
|
7522
|
+
(0, import_utils.compact)(
|
|
7523
|
+
selectedShapeIds.map((id) => {
|
|
7524
|
+
const shape = this.getShape(id);
|
|
7525
|
+
if (!shape) return;
|
|
7526
|
+
if ((0, import_utils.hasOwnProperty)(shape.props, "scale")) {
|
|
7527
|
+
const scale = shape.props["scale"];
|
|
7528
|
+
const change = info.delta.y / 100;
|
|
7529
|
+
const next = scale + change;
|
|
7530
|
+
return { ...shape, props: { scale: Math.max(0.01, next) } };
|
|
7531
|
+
}
|
|
7532
|
+
})
|
|
7533
|
+
)
|
|
7534
|
+
);
|
|
7535
|
+
return;
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7510
7538
|
let behavior = wheelBehavior;
|
|
7511
7539
|
if (info.ctrlKey) behavior = wheelBehavior === "pan" ? "zoom" : "pan";
|
|
7512
7540
|
switch (behavior) {
|