Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
release: add sketch revolve and configurable gears
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import { Grid3X3, Palette, Ruler, X } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { normalizeScaleForUnits, scaleOptionsForUnits, WORKSPACE_UNIT_OPTIONS } from "@/lib/measurementUnits";
|
||||
import { normalizeScaleForUnits, parseMeasurementInput, scaleOptionsForUnits, WORKSPACE_UNIT_OPTIONS } from "@/lib/measurementUnits";
|
||||
import { DEFAULT_WORKPLANE_WORKSPACE } from "@/lib/workplaneSettings";
|
||||
import type { GridSize, WorkplaneWorkspaceSettings } from "@/types/sketchforge";
|
||||
|
||||
@@ -56,6 +56,7 @@ export function WorkspaceSettingsModal({
|
||||
width: workspace.width.toFixed(workspace.accuracy),
|
||||
depth: workspace.depth.toFixed(workspace.accuracy),
|
||||
}));
|
||||
const [gridBlockSizeDraft, setGridBlockSizeDraft] = useState(() => workspace.gridBlockSize.toFixed(workspace.accuracy));
|
||||
const scaleOptions = scaleOptionsForUnits(workspace.units);
|
||||
const scaleValue = normalizeScaleForUnits(workspace.units, workspace.scale);
|
||||
useEffect(() => {
|
||||
@@ -64,13 +65,16 @@ export function WorkspaceSettingsModal({
|
||||
depth: workspace.depth.toFixed(workspace.accuracy),
|
||||
});
|
||||
}, [workspace.accuracy, workspace.depth, workspace.width]);
|
||||
useEffect(() => {
|
||||
setGridBlockSizeDraft(workspace.gridBlockSize.toFixed(workspace.accuracy));
|
||||
}, [workspace.accuracy, workspace.gridBlockSize]);
|
||||
const patchWorkspace = (patch: Partial<WorkspaceSettings>) => {
|
||||
setDefaultSaved(false);
|
||||
const next = { ...workspace, ...patch };
|
||||
onWorkspaceChange({ ...next, scale: normalizeScaleForUnits(next.units, next.scale) });
|
||||
};
|
||||
const setDimension = (key: "width" | "depth", value: string) => {
|
||||
const parsed = Number.parseFloat(value);
|
||||
const parsed = parseMeasurementInput(value);
|
||||
const next = clamp(Number.isFinite(parsed) ? parsed : workspace[key], MIN_WORKSPACE_SIZE, MAX_WORKSPACE_SIZE);
|
||||
setDimensionDrafts((current) => ({ ...current, [key]: next.toFixed(workspace.accuracy) }));
|
||||
patchWorkspace({ [key]: next, sizePreset: "Custom" } as Partial<WorkspaceSettings>);
|
||||
@@ -87,7 +91,9 @@ export function WorkspaceSettingsModal({
|
||||
patchWorkspace({ gridBlockPreset, gridBlockSize: gridBlockSizeForPreset(gridBlockPreset, workspace.gridBlockSize) });
|
||||
};
|
||||
const setGridBlockSize = (value: string) => {
|
||||
const next = clamp(Number.parseFloat(value) || DEFAULT_WORKPLANE_WORKSPACE.gridBlockSize, MIN_GRID_BLOCK_SIZE, MAX_GRID_BLOCK_SIZE);
|
||||
const parsed = parseMeasurementInput(value);
|
||||
const next = clamp(Number.isFinite(parsed) ? parsed : workspace.gridBlockSize, MIN_GRID_BLOCK_SIZE, MAX_GRID_BLOCK_SIZE);
|
||||
setGridBlockSizeDraft(next.toFixed(workspace.accuracy));
|
||||
patchWorkspace({ gridBlockPreset: "Custom", gridBlockSize: next });
|
||||
};
|
||||
|
||||
@@ -201,11 +207,9 @@ export function WorkspaceSettingsModal({
|
||||
<label>
|
||||
<span>Width</span>
|
||||
<input
|
||||
type="number"
|
||||
type="text"
|
||||
inputMode="decimal"
|
||||
value={dimensionDrafts.width}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
onChange={(event) => {
|
||||
const value = event.currentTarget.value;
|
||||
setDimensionDrafts((current) => ({ ...current, width: value }));
|
||||
@@ -219,11 +223,9 @@ export function WorkspaceSettingsModal({
|
||||
<label>
|
||||
<span>Length</span>
|
||||
<input
|
||||
type="number"
|
||||
type="text"
|
||||
inputMode="decimal"
|
||||
value={dimensionDrafts.depth}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
onChange={(event) => {
|
||||
const value = event.currentTarget.value;
|
||||
setDimensionDrafts((current) => ({ ...current, depth: value }));
|
||||
@@ -241,12 +243,14 @@ export function WorkspaceSettingsModal({
|
||||
<label>
|
||||
<span>Block size</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.gridBlockSize.toFixed(workspace.accuracy)}
|
||||
min={MIN_GRID_BLOCK_SIZE}
|
||||
max={MAX_GRID_BLOCK_SIZE}
|
||||
step={0.5}
|
||||
onChange={(event) => setGridBlockSize(event.currentTarget.value)}
|
||||
type="text"
|
||||
inputMode="decimal"
|
||||
value={gridBlockSizeDraft}
|
||||
onChange={(event) => setGridBlockSizeDraft(event.currentTarget.value)}
|
||||
onBlur={(event) => setGridBlockSize(event.currentTarget.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") event.currentTarget.blur();
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user