release: SketchForge 1.0.9

This commit is contained in:
Formsmith746
2026-09-02 17:18:31 +03:00
parent 2198c1fe79
commit 6b3e0e642d
9 changed files with 49 additions and 7 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
<a href="https://github.com/Formsmith746/SketchForge-3D/stargazers"><img alt="Star SketchForge on GitHub" src="https://img.shields.io/github/stars/Formsmith746/SketchForge-3D?style=flat&logo=github"></a>
<a href="https://github.com/sponsors/Formsmith746"><img alt="Sponsor SketchForge on GitHub" src="https://img.shields.io/badge/GitHub-Sponsor-ea4aaa?logo=githubsponsors&logoColor=white"></a>
<img alt="Local first" src="https://img.shields.io/badge/local--first-no%20account-0ea5e9">
<img alt="Version v1.0.8" src="https://img.shields.io/badge/version-v1.0.8-2563eb">
<img alt="Version v1.0.9" src="https://img.shields.io/badge/version-v1.0.9-2563eb">
</p>
</div>
@@ -7,6 +7,7 @@ import { SketchRevolvePreview } from "@/components/SketchRevolvePreview";
import { parseMeasurementInput } from "@/lib/measurementUnits";
import { WORKPLANE_MAJOR_GRID_INTERVAL } from "@/lib/workplaneGrid";
import { closestPointOnSketchSegment, type SketchSegmentPlacement } from "@/lib/sketchPointRefinement";
import { isSketchPanGesture } from "@/lib/sketchPointerControls";
import { mirrorSign, resizedImportedMeshPositions } from "@/lib/workplaneShapes";
import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings } from "@/lib/workplaneSettings";
import type { GridSize, SketchImage, SketchOperation, SketchPoint, SketchProfile, SketchSegment, WorkplaneShape, WorkplaneWorkspaceSettings } from "@/types/sketchforge";
@@ -637,6 +638,10 @@ export function SketchWorkspace({
setPointerAction({ kind: "pan", pointerId: event.pointerId, clientX: event.clientX, clientY: event.clientY });
};
const handlePanPointerDownCapture = (event: ReactPointerEvent<SVGSVGElement>) => {
if (isSketchPanGesture(event)) beginPan(event);
};
const handlePlanePointerDown = (event: ReactPointerEvent<SVGSVGElement>) => {
if (event.button === 1) {
beginPan(event);
@@ -794,6 +799,7 @@ export function SketchWorkspace({
className={`sketch-plate tool-${tool} ${pointerAction?.kind === "pan" ? "panning" : ""}`}
viewBox={`${pan.x - width / 2} ${pan.z - depth / 2} ${width} ${depth}`}
preserveAspectRatio="xMidYMid meet"
onPointerDownCapture={handlePanPointerDownCapture}
onPointerDown={handlePlanePointerDown}
onPointerMove={handlePointerMove}
onPointerUp={finishPointerAction}
@@ -803,6 +809,7 @@ export function SketchWorkspace({
setRefinePreview(null);
}}
onWheel={handleWheel}
onContextMenu={(event) => event.preventDefault()}
onDragOver={(event) => {
if (!event.dataTransfer.types.includes("application/x-sketchforge-sketch-primitive")) return;
event.preventDefault();
@@ -5278,8 +5278,10 @@ function createThreeScene(host: HTMLDivElement): ThreeState {
controls.maxDistance = 4200;
controls.minZoom = 0.02;
controls.maxZoom = 100;
controls.minPolarAngle = 0.06;
controls.maxPolarAngle = Math.PI - 0.06;
// Allow the documented OrbitControls pole limits so Top and Bottom views can
// settle on the vertical axis instead of being held roughly 3.4 degrees off it.
controls.minPolarAngle = 0;
controls.maxPolarAngle = Math.PI;
controls.target.copy(CAMERA_TARGET);
const ambient = new THREE.HemisphereLight("#ffffff", "#d6edf5", 2.1);
@@ -0,0 +1,9 @@
export type SketchPointerModifiers = {
button: number;
ctrlKey: boolean;
metaKey: boolean;
};
export function isSketchPanGesture(event: SketchPointerModifiers) {
return event.button === 1 || (event.button === 2 && (event.ctrlKey || event.metaKey));
}
+1 -1
View File
@@ -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.8";
export const SKF_CREATED_WITH_VERSION = "1.0.9";
export const SKF_MEDIA_TYPE = "application/vnd.sketchforge.project+zip";
export const SKF_LIMITS = {
+5
View File
@@ -1,5 +1,10 @@
# Changelog
## 1.0.9
- Corrected Top and Bottom camera views so they align exactly with the vertical axis in both perspective and orthographic projection.
- Added Ctrl/Cmd + right-button panning in Sketch mode while preserving middle-button panning.
## 1.0.8
- Duplicated objects now stay in the exact position of their source instead of receiving an automatic offset.
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "sketchforge",
"version": "1.0.8",
"version": "1.0.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sketchforge",
"version": "1.0.8",
"version": "1.0.9",
"license": "AGPL-3.0-only",
"dependencies": {
"@tailwindcss/postcss": "^4.1.8",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sketchforge",
"version": "1.0.8",
"version": "1.0.9",
"private": true,
"description": "A local-first 3D design editor.",
"author": {
+19
View File
@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { isSketchPanGesture } from "@/lib/sketchPointerControls";
describe("sketch pointer controls", () => {
it("pans with the middle mouse button", () => {
expect(isSketchPanGesture({ button: 1, ctrlKey: false, metaKey: false })).toBe(true);
});
it("pans with Ctrl or Cmd plus the right mouse button", () => {
expect(isSketchPanGesture({ button: 2, ctrlKey: true, metaKey: false })).toBe(true);
expect(isSketchPanGesture({ button: 2, ctrlKey: false, metaKey: true })).toBe(true);
});
it("does not repurpose unmodified or primary-button input", () => {
expect(isSketchPanGesture({ button: 2, ctrlKey: false, metaKey: false })).toBe(false);
expect(isSketchPanGesture({ button: 0, ctrlKey: true, metaKey: false })).toBe(false);
expect(isSketchPanGesture({ button: 0, ctrlKey: false, metaKey: true })).toBe(false);
});
});