diff --git a/.github/SETUP.md b/.github/SETUP.md
index 340cc0f..0818de7 100644
--- a/.github/SETUP.md
+++ b/.github/SETUP.md
@@ -32,7 +32,7 @@ permissions:
## Create a release
-Push a tag such as `v1.0.4`, or run `Desktop Release` with `workflow_dispatch` and enter `1.0.4`.
+Push a tag such as `v1.0.5`, or run `Desktop Release` with `workflow_dispatch` and enter `1.0.5`.
The workflow builds these packages:
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml
index 4f9b0ec..8d6736f 100644
--- a/.github/workflows/desktop-release.yml
+++ b/.github/workflows/desktop-release.yml
@@ -8,7 +8,7 @@ on:
workflow_dispatch:
inputs:
version:
- description: "Version to release (for example 1.0.4)"
+ description: "Version to release (for example 1.0.5)"
required: true
type: string
diff --git a/README.md b/README.md
index c0fbecf..50dc8f4 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
-
+
diff --git a/apps/web/src/app/globals.css b/apps/web/src/app/globals.css
index 525c711..6c95e7a 100644
--- a/apps/web/src/app/globals.css
+++ b/apps/web/src/app/globals.css
@@ -4737,8 +4737,8 @@ button {
.rotate-handle {
z-index: 3;
- width: 42px;
- height: 42px;
+ width: 52px;
+ height: 52px;
color: rgba(47, 61, 70, 0.6);
background: transparent;
border: 0;
@@ -4746,7 +4746,7 @@ button {
box-shadow: none;
cursor: grab;
opacity: 1;
- transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%) rotate(var(--rotate-handle-angle, 0deg));
+ transform: translate3d(var(--overlay-x, 0), var(--overlay-y, 0), 0) translate(-50%, -50%);
}
.rotate-handle:hover {
@@ -4756,8 +4756,8 @@ button {
.rotate-handle-icon,
.rotate-handle-icon svg {
display: block;
- width: 18px;
- height: 18px;
+ width: 26px;
+ height: 26px;
}
.rotate-handle-icon {
@@ -4769,6 +4769,16 @@ button {
.rotate-handle-icon svg {
fill: currentColor;
+ transform: matrix(
+ var(--rotate-plane-a, 1),
+ var(--rotate-plane-b, 0),
+ var(--rotate-plane-c, 0),
+ var(--rotate-plane-d, 1),
+ 0,
+ 0
+ );
+ transform-box: fill-box;
+ transform-origin: center;
}
.rotation-edit {
diff --git a/apps/web/src/components/WorkplaneViewport.tsx b/apps/web/src/components/WorkplaneViewport.tsx
index 4bb5fc5..9dd001f 100644
--- a/apps/web/src/components/WorkplaneViewport.tsx
+++ b/apps/web/src/components/WorkplaneViewport.tsx
@@ -42,7 +42,7 @@ import {
type PlacementWorkplane,
} from "@/lib/placementWorkplane";
import { regularPolygonFootprintScale } from "@/lib/regularPolygonFootprint";
-import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
+import { canBeginShapeDrag, DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
import { interiorWorkplaneGridCoordinates, workplaneThemePalette, WORKPLANE_LINE_ELEVATION, WORKPLANE_MAJOR_GRID_INTERVAL } from "@/lib/workplaneGrid";
import { cleanNearZero, cleanRotationDegrees, fallbackSolidColor, mirroredAxisCount, mirrorSign, preservesEdgeTreatmentSize, proportionalResizeScale, resizedImportedCoordinates, resizedImportedMeshPositions, resizedShapeSize, shapeDepth, shapeHasTaper, shapeOverallFootprintDimensions, shapeTaperDimensions, shapeTaperScaleAt, shapeWidth } from "@/lib/workplaneShapes";
import { sphereTessellation } from "@/lib/sphereTessellation";
@@ -51,6 +51,7 @@ import {
TransformOverlay,
getElevationMeasureKey,
measureKeyForHandle,
+ normalizedRotationPlaneBasis,
type DimensionMark,
type EditingDimension,
type EditingRotation,
@@ -1837,8 +1838,6 @@ function signedAngleAroundAxis(start: THREE.Vector3, current: THREE.Vector3, axi
const ROTATION_HANDLE_SIDE_HYSTERESIS = 0.22;
const ROTATION_HANDLE_DOMINANCE_HYSTERESIS = 0.18;
-const ROTATION_UPPER_HANDLE_ICON_ANGLE = 0;
-const ROTATION_BOTTOM_HANDLE_ICON_ANGLE = 0;
function signedRotationSide(value: number, previous: RotationHandleSide | undefined, positiveSide: RotationHandleSide, negativeSide: RotationHandleSide) {
if (previous === positiveSide && value > -ROTATION_HANDLE_SIDE_HYSTERESIS) {
return previous;
@@ -1896,9 +1895,10 @@ function rotationHandleSidesForCamera(
const viewZ = viewZRaw / length;
const previous = state.rotationHandleSides ?? undefined;
const next: RotationHandleSides = {
- x: signedRotationSide(viewX, previous?.x, "right", "left"),
+ // Keep the two upper rotation handles on the faces opposite the camera.
+ x: signedRotationSide(viewX, previous?.x, "left", "right"),
y: dominantRotationSide(viewX, viewZ, previous?.y),
- z: signedRotationSide(viewZ, previous?.z, "near", "far"),
+ z: signedRotationSide(viewZ, previous?.z, "far", "near"),
};
state.rotationHandleSides = next;
return next;
@@ -4262,6 +4262,9 @@ export function WorkplaneViewport({
if (!alreadySelected) {
onSelectShape(id);
}
+ if (!canBeginShapeDrag(workspaceRef.current.selectBeforeMove, alreadySelected)) {
+ return;
+ }
if (shape.locked) {
return;
}
@@ -6231,7 +6234,10 @@ function updateTransformOverlayDom(state: ThreeState, next: TransformOverlayStat
}
element.style.setProperty("--overlay-x", `${handle.x}px`);
element.style.setProperty("--overlay-y", `${handle.y}px`);
- element.style.setProperty("--rotate-handle-angle", `${handle.angle}deg`);
+ element.style.setProperty("--rotate-plane-a", String(handle.plane.a));
+ element.style.setProperty("--rotate-plane-b", String(handle.plane.b));
+ element.style.setProperty("--rotate-plane-c", String(handle.plane.c));
+ element.style.setProperty("--rotate-plane-d", String(handle.plane.d));
});
}
@@ -6438,37 +6444,34 @@ function syncTransformOverlay(
};
const rotateLeft = screenOffsetFromCenter(project(sidePoint(rotationSides.x, frame.max.y)), 24);
const rotateRight = screenOffsetFromCenter(project(sidePoint(rotationSides.z, frame.max.y)), 28);
- const rotateBottom = screenOffsetFromCenter(project(sidePoint(rotationSides.y, footprintY)), 34);
+ const rotateBottomAnchor = screenOffsetFromCenter(project(sidePoint(rotationSides.y, footprintY)), 26);
+ const rotateBottom = { ...rotateBottomAnchor, y: rotateBottomAnchor.y - 5 };
const xFaceCenter = sidePoint(rotationSides.x, 0);
const zFaceCenter = sidePoint(rotationSides.z, 0);
const yFaceCenter = bottomCenterWorld;
- const projectedAxisAngle = (centerWorld: THREE.Vector3, axis: THREE.Vector3) => {
- const from = project(centerWorld.clone().addScaledVector(axis, -1));
- const to = project(centerWorld.clone().addScaledVector(axis, 1));
- return THREE.MathUtils.radToDeg(Math.atan2(to.y - from.y, to.x - from.x));
- };
- const rotateWithWorkplane = !placementWorkplaneIsBase(activeWorkplane);
- const xRotateAngle = rotateWithWorkplane
- ? projectedAxisAngle(xFaceCenter, zFootAxis)
- : ROTATION_UPPER_HANDLE_ICON_ANGLE;
- const zRotateAngle = rotateWithWorkplane
- ? projectedAxisAngle(zFaceCenter, xFootAxis)
- : ROTATION_UPPER_HANDLE_ICON_ANGLE;
- const yRotateTangent = rotationSides.y === "right" || rotationSides.y === "left"
- ? zFootAxis
- : xFootAxis;
- const yRotateAngle = rotateWithWorkplane
- ? projectedAxisAngle(yFaceCenter, yRotateTangent)
- : ROTATION_BOTTOM_HANDLE_ICON_ANGLE;
+ const yRotationAxes = rotationSides.y === "near"
+ ? { u: xFootAxis, v: zFootAxis }
+ : rotationSides.y === "far"
+ ? { u: xFootAxis.clone().multiplyScalar(-1), v: zFootAxis.clone().multiplyScalar(-1) }
+ : rotationSides.y === "right"
+ ? { u: zFootAxis.clone().multiplyScalar(-1), v: xFootAxis }
+ : { u: zFootAxis, v: xFootAxis.clone().multiplyScalar(-1) };
const planeRadius = 154;
- const planeWorldStep = Math.max(12, Math.max(frame.width, frame.depth, frame.height) * 0.78);
+ const planeWorldStep = Math.max(0.1, cameraDistance * 0.01);
const makePlaneView = (centerWorld: THREE.Vector3, uAxis: THREE.Vector3, vAxis: THREE.Vector3): RotationPlaneView => {
const screenCenter = project(centerWorld);
- const u = project(centerWorld.clone().add(uAxis.clone().multiplyScalar(planeWorldStep)));
- const v = project(centerWorld.clone().add(vAxis.clone().multiplyScalar(planeWorldStep)));
- const du = { x: u.x - screenCenter.x, y: u.y - screenCenter.y };
- const dv = { x: v.x - screenCenter.x, y: v.y - screenCenter.y };
- const longest = Math.max(12, Math.hypot(du.x, du.y), Math.hypot(dv.x, dv.y));
+ const uOffset = uAxis.clone().multiplyScalar(planeWorldStep);
+ const vOffset = vAxis.clone().multiplyScalar(planeWorldStep);
+ const uStart = project(centerWorld.clone().sub(uOffset));
+ const uEnd = project(centerWorld.clone().add(uOffset));
+ const vStart = project(centerWorld.clone().sub(vOffset));
+ const vEnd = project(centerWorld.clone().add(vOffset));
+ const du = { x: (uEnd.x - uStart.x) / 2, y: (uEnd.y - uStart.y) / 2 };
+ const dv = { x: (vEnd.x - vStart.x) / 2, y: (vEnd.y - vStart.y) / 2 };
+ const longest = Math.max(Math.hypot(du.x, du.y), Math.hypot(dv.x, dv.y));
+ if (!Number.isFinite(longest) || longest < 0.000001) {
+ return { x: screenCenter.x, y: screenCenter.y, a: 1, b: 0, c: 0, d: 1 };
+ }
const scale = planeRadius / longest / 100;
return {
x: screenCenter.x,
@@ -6499,6 +6502,19 @@ function syncTransformOverlay(
y: makePlaneView(yFaceCenter, xFootAxis, zFootAxis),
z: makePlaneView(zFaceCenter, xFootAxis, yFootAxis),
};
+ const makeCameraPlaneView = (uAxis: THREE.Vector3, vAxis: THREE.Vector3): RotationPlaneView => {
+ const u = uAxis.clone().transformDirection(state.camera.matrixWorldInverse);
+ const v = vAxis.clone().transformDirection(state.camera.matrixWorldInverse);
+ return { x: 0, y: 0, a: u.x, b: -u.y, c: v.x, d: -v.y };
+ };
+ const rotationHandlePlanes: Record = {
+ // Project only the two plane axes through the camera rotation. Ignoring
+ // perspective translation keeps glyph appearance independent of object
+ // length and screen position while preserving camera foreshortening.
+ x: makeCameraPlaneView(zFootAxis, yFootAxis),
+ y: makeCameraPlaneView(yRotationAxes.u, yRotationAxes.v),
+ z: makeCameraPlaneView(xFootAxis, yFootAxis),
+ };
const next = {
id: frame.ids.join("|"),
@@ -6521,9 +6537,9 @@ function syncTransformOverlay(
{ key: liftHandleKey, className: showLowerHandles ? "height-lift lower" : "height-lift", kind: "lift" as const, x: liftPoint.x, y: liftPoint.y, title: "Lift", angle: liftHandleAngle },
],
rotateHandles: [
- { key: "rotate-left", className: "screen-left", x: rotateLeft.x, y: rotateLeft.y, angle: xRotateAngle },
- { key: "rotate-right", className: "screen-right", x: rotateRight.x, y: rotateRight.y, angle: zRotateAngle },
- { key: "rotate-bottom", className: "screen-bottom", x: rotateBottom.x, y: rotateBottom.y, angle: yRotateAngle },
+ { key: "rotate-left", className: "screen-left", x: rotateLeft.x, y: rotateLeft.y, plane: normalizedRotationPlaneBasis(rotationHandlePlanes.x, true) },
+ { key: "rotate-right", className: "screen-right", x: rotateRight.x, y: rotateRight.y, plane: normalizedRotationPlaneBasis(rotationHandlePlanes.z, true) },
+ { key: "rotate-bottom", className: "screen-bottom", x: rotateBottom.x, y: rotateBottom.y, plane: normalizedRotationPlaneBasis(rotationHandlePlanes.y, true) },
],
dimensions: dimensionMarks,
rotationWheel: rotationWheels.y,
diff --git a/apps/web/src/components/workplane/TransformOverlay.tsx b/apps/web/src/components/workplane/TransformOverlay.tsx
index bccf294..998397a 100644
--- a/apps/web/src/components/workplane/TransformOverlay.tsx
+++ b/apps/web/src/components/workplane/TransformOverlay.tsx
@@ -9,11 +9,13 @@ import {
export {
getElevationMeasureKey,
measureKeyForHandle,
+ normalizedRotationPlaneBasis,
type DimensionMark,
type EditingDimension,
type EditingRotation,
type PinnedRotationWheelView,
type RotationAxis,
+ type RotationPlaneBasis,
type RotationPlaneView,
type RotationReadout,
type RotationWheelView,
@@ -240,7 +242,14 @@ export function TransformOverlay({
{
if (event.button === 0) {
diff --git a/apps/web/src/components/workplane/WorkspaceSettingsModal.tsx b/apps/web/src/components/workplane/WorkspaceSettingsModal.tsx
index 8d07122..a805d80 100644
--- a/apps/web/src/components/workplane/WorkspaceSettingsModal.tsx
+++ b/apps/web/src/components/workplane/WorkspaceSettingsModal.tsx
@@ -202,6 +202,11 @@ export function WorkspaceSettingsModal({
checked={moveDimensionsEnabled}
onChange={onMoveDimensionsEnabledChange}
/>
+ patchWorkspace({ selectBeforeMove })}
+ />
patchWorkspace({ showShadows })} />
;
+
+export function normalizedRotationPlaneBasis(plane: RotationPlaneView, invertVerticalAxis = false): RotationPlaneBasis {
+ const longestAxis = Math.max(Math.hypot(plane.a, plane.b), Math.hypot(plane.c, plane.d));
+ if (!Number.isFinite(longestAxis) || longestAxis < 0.000001) {
+ return { a: 1, b: 0, c: 0, d: 1 };
+ }
+ return {
+ a: plane.a / longestAxis,
+ b: plane.b / longestAxis,
+ c: (plane.c / longestAxis) * (invertVerticalAxis ? -1 : 1),
+ d: (plane.d / longestAxis) * (invertVerticalAxis ? -1 : 1),
+ };
+}
+
export type PinnedRotationWheelView = {
axis: RotationAxis;
wheel: RotationWheelView;
@@ -46,7 +61,7 @@ export type TransformOverlayState = {
height: number;
guides: Array<{ x1: number; y1: number; x2: number; y2: number }>;
handles: Array<{ key: string; className: string; kind: TransformHandleKind; x: number; y: number; title: string; angle?: number }>;
- rotateHandles: Array<{ key: string; className: string; x: number; y: number; angle: number }>;
+ rotateHandles: Array<{ key: string; className: string; x: number; y: number; plane: RotationPlaneBasis }>;
dimensions: Record;
rotationWheel: RotationWheelView | null;
rotationWheels: Record;
diff --git a/apps/web/src/lib/skfProject.ts b/apps/web/src/lib/skfProject.ts
index 4397242..386a535 100644
--- a/apps/web/src/lib/skfProject.ts
+++ b/apps/web/src/lib/skfProject.ts
@@ -12,7 +12,7 @@ import type { GridSize, ProjectAsset, ProjectAssetSourceFormat, SketchOperation,
export const SKF_SCHEMA_ID = "com.sketchforge.project";
export const SKF_FORMAT_VERSION = 1;
export const SKF_MINIMUM_READER_VERSION = 1;
-export const SKF_CREATED_WITH_VERSION = "1.0.4";
+export const SKF_CREATED_WITH_VERSION = "1.0.5";
export const SKF_MEDIA_TYPE = "application/vnd.sketchforge.project+zip";
export const SKF_LIMITS = {
diff --git a/apps/web/src/lib/workplaneSettings.ts b/apps/web/src/lib/workplaneSettings.ts
index f135908..7460fa4 100644
--- a/apps/web/src/lib/workplaneSettings.ts
+++ b/apps/web/src/lib/workplaneSettings.ts
@@ -15,6 +15,7 @@ export const DEFAULT_WORKPLANE_WORKSPACE: WorkplaneWorkspaceSettings = {
showShadows: true,
showGrid: true,
cruiseShapes: true,
+ selectBeforeMove: false,
zoomSpeed: 5,
units: "Metric (Default)",
scale: "1:1 (millimeters)",
@@ -68,6 +69,7 @@ export function normalizeWorkspaceSettings(value: unknown, fallback: WorkplaneWo
showShadows: booleanOrDefault(candidate.showShadows, fallback.showShadows),
showGrid: booleanOrDefault(candidate.showGrid, fallback.showGrid),
cruiseShapes: booleanOrDefault(candidate.cruiseShapes, fallback.cruiseShapes),
+ selectBeforeMove: booleanOrDefault(candidate.selectBeforeMove, fallback.selectBeforeMove),
zoomSpeed: numberOrDefault(candidate.zoomSpeed, fallback.zoomSpeed),
units,
scale: normalizeScaleForUnits(units, stringOrDefault(candidate.scale, fallback.scale)),
@@ -76,6 +78,10 @@ export function normalizeWorkspaceSettings(value: unknown, fallback: WorkplaneWo
};
}
+export function canBeginShapeDrag(selectBeforeMove: boolean, alreadySelected: boolean) {
+ return !selectBeforeMove || alreadySelected;
+}
+
export function workplaneSettingsFingerprint(workspace: WorkplaneWorkspaceSettings, snapGrid: GridSize) {
return JSON.stringify({ workspace, snapGrid });
}
diff --git a/apps/web/src/types/sketchforge.ts b/apps/web/src/types/sketchforge.ts
index b30d17a..f63e6db 100644
--- a/apps/web/src/types/sketchforge.ts
+++ b/apps/web/src/types/sketchforge.ts
@@ -55,6 +55,7 @@ export type WorkplaneWorkspaceSettings = {
showShadows: boolean;
showGrid: boolean;
cruiseShapes: boolean;
+ selectBeforeMove: boolean;
zoomSpeed: number;
units: string;
scale: string;
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index a9ae617..f91a174 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog
+## 1.0.5
+
+- Made the rotation handles larger and aligned their arrow glyphs with the model faces as the camera moves, including stable behavior on long objects.
+- Positioned the lower rotation handle consistently at the model base and corrected its visual and drag directions.
+- Added an optional **Select before moving** workspace setting so the first click selects an object without immediately dragging it.
+
## 1.0.4
- Fixed imported STL objects briefly appearing and then vanishing when a stale IndexedDB project read completed after the import.
diff --git a/package-lock.json b/package-lock.json
index edc34f0..a876674 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "sketchforge",
- "version": "1.0.4",
+ "version": "1.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sketchforge",
- "version": "1.0.4",
+ "version": "1.0.5",
"license": "AGPL-3.0-only",
"dependencies": {
"@tailwindcss/postcss": "^4.1.8",
diff --git a/package.json b/package.json
index 59d3379..29188ee 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sketchforge",
- "version": "1.0.4",
+ "version": "1.0.5",
"private": true,
"description": "A local-first 3D design editor.",
"author": {
diff --git a/tests/unit/transformOverlayTypes.test.ts b/tests/unit/transformOverlayTypes.test.ts
new file mode 100644
index 0000000..e4873c4
--- /dev/null
+++ b/tests/unit/transformOverlayTypes.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it } from "vitest";
+import { normalizedRotationPlaneBasis } from "@/components/workplane/transformOverlayTypes";
+
+describe("rotation handle projection", () => {
+ it("preserves face-plane foreshortening while normalizing icon size", () => {
+ expect(normalizedRotationPlaneBasis({ x: 10, y: 20, a: 2, b: 0, c: 0.5, d: 1 })).toEqual({
+ a: 1,
+ b: 0,
+ c: 0.25,
+ d: 0.5,
+ });
+ });
+
+ it("turns an upper arrow upright without detaching it from the face plane", () => {
+ expect(normalizedRotationPlaneBasis({ x: 10, y: 20, a: 2, b: 0, c: 0.5, d: 1 }, true)).toEqual({
+ a: 1,
+ b: 0,
+ c: -0.25,
+ d: -0.5,
+ });
+ });
+
+ it("falls back to a screen-facing icon for a collapsed projection", () => {
+ expect(normalizedRotationPlaneBasis({ x: 10, y: 20, a: 0, b: 0, c: 0, d: 0 })).toEqual({
+ a: 1,
+ b: 0,
+ c: 0,
+ d: 1,
+ });
+ });
+});
diff --git a/tests/unit/workplaneSettings.test.ts b/tests/unit/workplaneSettings.test.ts
index e93e3fd..ffe5ea2 100644
--- a/tests/unit/workplaneSettings.test.ts
+++ b/tests/unit/workplaneSettings.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { WorkplaneWorkspaceSettings } from "@/types/sketchforge";
import { formatMeasurementNumber, lengthDisplayUnit, millimetersToDisplay, normalizeScaleForUnits, parseMeasurementInput, scaleOptionsForUnits } from "@/lib/measurementUnits";
-import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
+import { canBeginShapeDrag, DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
describe("workplane settings helpers", () => {
it("accepts known snap grid values and falls back for unknown values", () => {
@@ -32,6 +32,7 @@ describe("workplane settings helpers", () => {
showShadows: false,
showGrid: false,
cruiseShapes: false,
+ selectBeforeMove: true,
zoomSpeed: Infinity,
units: "Bricks",
scale: "1:10 (centimeters)",
@@ -49,6 +50,7 @@ describe("workplane settings helpers", () => {
showShadows: false,
showGrid: false,
cruiseShapes: false,
+ selectBeforeMove: true,
units: "Bricks",
scale: "1:1 (studs)",
accuracy: 3,
@@ -61,6 +63,12 @@ describe("workplane settings helpers", () => {
expect(normalizeWorkspaceSettings({ gridColor: "not-a-color" }).gridColor).toBe(DEFAULT_WORKPLANE_WORKSPACE.gridColor);
});
+ it("can require selection before a shape starts moving", () => {
+ expect(canBeginShapeDrag(false, false)).toBe(true);
+ expect(canBeginShapeDrag(true, false)).toBe(false);
+ expect(canBeginShapeDrag(true, true)).toBe(true);
+ });
+
it("keeps scale options in the selected unit family", () => {
expect(scaleOptionsForUnits("Metric (Default)")).toEqual(["1:1 (millimeters)", "1:10 (centimeters)", "1:1000 (meters)"]);
expect(normalizeScaleForUnits("Metric (Default)", "1:100 (meters)")).toBe("1:1000 (meters)");