release: SketchForge 1.0.5

This commit is contained in:
Formsmith746
2026-08-23 13:28:52 +03:00
parent 95b029e274
commit 1100e4f718
16 changed files with 156 additions and 49 deletions
+31
View File
@@ -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,
});
});
});
+9 -1
View File
@@ -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)");