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
@@ -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({
<button
key={handle.key}
className={`rotate-handle ${handle.className}`}
style={{ "--overlay-x": `${handle.x}px`, "--overlay-y": `${handle.y}px`, "--rotate-handle-angle": `${handle.angle}deg` } as CSSProperties}
style={{
"--overlay-x": `${handle.x}px`,
"--overlay-y": `${handle.y}px`,
"--rotate-plane-a": handle.plane.a,
"--rotate-plane-b": handle.plane.b,
"--rotate-plane-c": handle.plane.c,
"--rotate-plane-d": handle.plane.d,
} as CSSProperties}
title="Rotate"
onPointerDown={(event) => {
if (event.button === 0) {
@@ -202,6 +202,11 @@ export function WorkspaceSettingsModal({
checked={moveDimensionsEnabled}
onChange={onMoveDimensionsEnabledChange}
/>
<WorkspaceToggle
label="Select before moving"
checked={workspace.selectBeforeMove}
onChange={(selectBeforeMove) => patchWorkspace({ selectBeforeMove })}
/>
<WorkspaceToggle label="Show shadows" checked={workspace.showShadows} onChange={(showShadows) => patchWorkspace({ showShadows })} />
<WorkspaceToggle
label="Cruise when adding new shapes"
@@ -13,6 +13,21 @@ export type RotationPlaneView = {
d: number;
};
export type RotationPlaneBasis = Pick<RotationPlaneView, "a" | "b" | "c" | "d">;
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<string, DimensionMark[]>;
rotationWheel: RotationWheelView | null;
rotationWheels: Record<RotationAxis, RotationWheelView>;