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
Pin rotation wheel during drag
This commit is contained in:
@@ -197,6 +197,8 @@ type RotationHandleSide = "near" | "right" | "far" | "left";
|
|||||||
type RotationHandleSides = Record<RotationAxis, RotationHandleSide>;
|
type RotationHandleSides = Record<RotationAxis, RotationHandleSide>;
|
||||||
type ShapeUpdatePatch = Partial<WorkplaneShape> & { bakeTransform?: boolean };
|
type ShapeUpdatePatch = Partial<WorkplaneShape> & { bakeTransform?: boolean };
|
||||||
type ResizeSigns = { x: number; z: number };
|
type ResizeSigns = { x: number; z: number };
|
||||||
|
type RotationWheelView = { x: number; y: number; radius: number };
|
||||||
|
type PinnedRotationWheelView = { axis: RotationAxis; wheel: RotationWheelView; plane: RotationPlaneView };
|
||||||
type TransformDragState = {
|
type TransformDragState = {
|
||||||
id: string;
|
id: string;
|
||||||
ids: string[];
|
ids: string[];
|
||||||
@@ -226,7 +228,7 @@ type TransformDragState = {
|
|||||||
rotationScreenCenter?: { x: number; y: number };
|
rotationScreenCenter?: { x: number; y: number };
|
||||||
rotationScreenSign?: number;
|
rotationScreenSign?: number;
|
||||||
rotationStartQuaternion?: THREE.Quaternion;
|
rotationStartQuaternion?: THREE.Quaternion;
|
||||||
wheelCenter?: { x: number; y: number; radius: number };
|
wheelCenter?: RotationWheelView;
|
||||||
hasMoved?: boolean;
|
hasMoved?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -245,8 +247,8 @@ type TransformOverlayState = {
|
|||||||
handles: Array<{ key: string; className: string; kind: TransformHandleKind; x: number; y: number; title: string }>;
|
handles: Array<{ key: string; className: string; kind: TransformHandleKind; x: number; y: number; title: string }>;
|
||||||
rotateHandles: Array<{ key: string; className: string; x: number; y: number; angle: number }>;
|
rotateHandles: Array<{ key: string; className: string; x: number; y: number; angle: number }>;
|
||||||
dimensions: Record<string, DimensionMark[]>;
|
dimensions: Record<string, DimensionMark[]>;
|
||||||
rotationWheel: { x: number; y: number; radius: number } | null;
|
rotationWheel: RotationWheelView | null;
|
||||||
rotationWheels: Record<RotationAxis, { x: number; y: number; radius: number }>;
|
rotationWheels: Record<RotationAxis, RotationWheelView>;
|
||||||
rotationPlaneCenters: Record<RotationAxis, { x: number; y: number; z: number }>;
|
rotationPlaneCenters: Record<RotationAxis, { x: number; y: number; z: number }>;
|
||||||
rotationPlanes: Record<RotationAxis, RotationPlaneView>;
|
rotationPlanes: Record<RotationAxis, RotationPlaneView>;
|
||||||
};
|
};
|
||||||
@@ -981,6 +983,7 @@ export function WorkplaneViewport({
|
|||||||
const [activeRotationWheel, setActiveRotationWheel] = useState(false);
|
const [activeRotationWheel, setActiveRotationWheel] = useState(false);
|
||||||
const [activeTransformKind, setActiveTransformKind] = useState<TransformHandleKind | null>(null);
|
const [activeTransformKind, setActiveTransformKind] = useState<TransformHandleKind | null>(null);
|
||||||
const [rotationWheelAxis, setRotationWheelAxis] = useState<RotationAxis>("y");
|
const [rotationWheelAxis, setRotationWheelAxis] = useState<RotationAxis>("y");
|
||||||
|
const [pinnedRotationWheelView, setPinnedRotationWheelView] = useState<PinnedRotationWheelView | null>(null);
|
||||||
const [editingDimension, setEditingDimension] = useState<EditingDimension>(null);
|
const [editingDimension, setEditingDimension] = useState<EditingDimension>(null);
|
||||||
const [editingRotation, setEditingRotation] = useState<EditingRotation>(null);
|
const [editingRotation, setEditingRotation] = useState<EditingRotation>(null);
|
||||||
const hostRef = useRef<HTMLDivElement | null>(null);
|
const hostRef = useRef<HTMLDivElement | null>(null);
|
||||||
@@ -1301,6 +1304,7 @@ export function WorkplaneViewport({
|
|||||||
const startWorldY = yStart + liftOffset;
|
const startWorldY = yStart + liftOffset;
|
||||||
const overlay = transformOverlayRef.current;
|
const overlay = transformOverlayRef.current;
|
||||||
const wheel = kind === "rotate" ? (overlay?.rotationWheels[rotationAxis] ?? overlay?.rotationWheel ?? undefined) : undefined;
|
const wheel = kind === "rotate" ? (overlay?.rotationWheels[rotationAxis] ?? overlay?.rotationWheel ?? undefined) : undefined;
|
||||||
|
const rotationPlane = kind === "rotate" ? overlay?.rotationPlanes[rotationAxis] : undefined;
|
||||||
const rotationPlaneCenterData = kind === "rotate" ? overlay?.rotationPlaneCenters[rotationAxis] : undefined;
|
const rotationPlaneCenterData = kind === "rotate" ? overlay?.rotationPlaneCenters[rotationAxis] : undefined;
|
||||||
const rotationPlaneCenter = rotationPlaneCenterData
|
const rotationPlaneCenter = rotationPlaneCenterData
|
||||||
? new THREE.Vector3(rotationPlaneCenterData.x, rotationPlaneCenterData.y, rotationPlaneCenterData.z)
|
? new THREE.Vector3(rotationPlaneCenterData.x, rotationPlaneCenterData.y, rotationPlaneCenterData.z)
|
||||||
@@ -1332,6 +1336,9 @@ export function WorkplaneViewport({
|
|||||||
setActiveTransformKind(kind);
|
setActiveTransformKind(kind);
|
||||||
if (kind === "rotate") {
|
if (kind === "rotate") {
|
||||||
setRotationWheelAxis(rotationAxis);
|
setRotationWheelAxis(rotationAxis);
|
||||||
|
setPinnedRotationWheelView(wheel && rotationPlane ? { axis: rotationAxis, wheel: { ...wheel }, plane: { ...rotationPlane } } : null);
|
||||||
|
} else {
|
||||||
|
setPinnedRotationWheelView(null);
|
||||||
}
|
}
|
||||||
transformRef.current = {
|
transformRef.current = {
|
||||||
id: shape.id,
|
id: shape.id,
|
||||||
@@ -1571,6 +1578,7 @@ export function WorkplaneViewport({
|
|||||||
transformRef.current = null;
|
transformRef.current = null;
|
||||||
setActiveRotationWheel(false);
|
setActiveRotationWheel(false);
|
||||||
setActiveTransformKind(null);
|
setActiveTransformKind(null);
|
||||||
|
setPinnedRotationWheelView(null);
|
||||||
setRotationReadout(null);
|
setRotationReadout(null);
|
||||||
if (threeRef.current) {
|
if (threeRef.current) {
|
||||||
threeRef.current.controls.enabled = true;
|
threeRef.current.controls.enabled = true;
|
||||||
@@ -1794,6 +1802,7 @@ export function WorkplaneViewport({
|
|||||||
const scaleSigns = handle.kind === "scale" ? resizeSignsForHandle(resizeHandleKey) : undefined;
|
const scaleSigns = handle.kind === "scale" ? resizeSignsForHandle(resizeHandleKey) : undefined;
|
||||||
const scaleAnchorPoint = handle.kind === "scale" && scaleSigns ? resizeAnchorPointForFrame(frame, scaleSigns) : undefined;
|
const scaleAnchorPoint = handle.kind === "scale" && scaleSigns ? resizeAnchorPointForFrame(frame, scaleSigns) : undefined;
|
||||||
const wheel = handle.kind === "rotate" ? (overlay?.rotationWheels[rotationAxis] ?? overlay?.rotationWheel ?? undefined) : undefined;
|
const wheel = handle.kind === "rotate" ? (overlay?.rotationWheels[rotationAxis] ?? overlay?.rotationWheel ?? undefined) : undefined;
|
||||||
|
const rotationPlane = handle.kind === "rotate" ? overlay?.rotationPlanes[rotationAxis] : undefined;
|
||||||
const rotationPlaneCenterData = handle.kind === "rotate" ? overlay?.rotationPlaneCenters[rotationAxis] : undefined;
|
const rotationPlaneCenterData = handle.kind === "rotate" ? overlay?.rotationPlaneCenters[rotationAxis] : undefined;
|
||||||
const rotationPlaneCenter = rotationPlaneCenterData
|
const rotationPlaneCenter = rotationPlaneCenterData
|
||||||
? new THREE.Vector3(rotationPlaneCenterData.x, rotationPlaneCenterData.y, rotationPlaneCenterData.z)
|
? new THREE.Vector3(rotationPlaneCenterData.x, rotationPlaneCenterData.y, rotationPlaneCenterData.z)
|
||||||
@@ -1816,6 +1825,9 @@ export function WorkplaneViewport({
|
|||||||
setActiveTransformKind(handle.kind);
|
setActiveTransformKind(handle.kind);
|
||||||
if (handle.kind === "rotate") {
|
if (handle.kind === "rotate") {
|
||||||
setRotationWheelAxis(rotationAxis);
|
setRotationWheelAxis(rotationAxis);
|
||||||
|
setPinnedRotationWheelView(wheel && rotationPlane ? { axis: rotationAxis, wheel: { ...wheel }, plane: { ...rotationPlane } } : null);
|
||||||
|
} else {
|
||||||
|
setPinnedRotationWheelView(null);
|
||||||
}
|
}
|
||||||
transformRef.current = {
|
transformRef.current = {
|
||||||
id: handle.id,
|
id: handle.id,
|
||||||
@@ -2264,6 +2276,7 @@ export function WorkplaneViewport({
|
|||||||
showRotationWheel={activeRotationWheel}
|
showRotationWheel={activeRotationWheel}
|
||||||
hideDimensionMarks={activeTransformKind === "scale"}
|
hideDimensionMarks={activeTransformKind === "scale"}
|
||||||
rotationWheelAxis={rotationWheelAxis}
|
rotationWheelAxis={rotationWheelAxis}
|
||||||
|
pinnedRotationWheelView={pinnedRotationWheelView}
|
||||||
onBeginTransform={beginTransform}
|
onBeginTransform={beginTransform}
|
||||||
onMoveTransform={updateTransform}
|
onMoveTransform={updateTransform}
|
||||||
onFinishTransform={finishTransform}
|
onFinishTransform={finishTransform}
|
||||||
@@ -2597,6 +2610,7 @@ function TransformOverlay({
|
|||||||
showRotationWheel,
|
showRotationWheel,
|
||||||
hideDimensionMarks,
|
hideDimensionMarks,
|
||||||
rotationWheelAxis,
|
rotationWheelAxis,
|
||||||
|
pinnedRotationWheelView,
|
||||||
onBeginTransform,
|
onBeginTransform,
|
||||||
onMoveTransform,
|
onMoveTransform,
|
||||||
onFinishTransform,
|
onFinishTransform,
|
||||||
@@ -2620,6 +2634,7 @@ function TransformOverlay({
|
|||||||
showRotationWheel: boolean;
|
showRotationWheel: boolean;
|
||||||
hideDimensionMarks: boolean;
|
hideDimensionMarks: boolean;
|
||||||
rotationWheelAxis: RotationAxis;
|
rotationWheelAxis: RotationAxis;
|
||||||
|
pinnedRotationWheelView: PinnedRotationWheelView | null;
|
||||||
onBeginTransform: (kind: TransformHandleKind, handleKey: string, event: ReactPointerEvent<Element>) => void;
|
onBeginTransform: (kind: TransformHandleKind, handleKey: string, event: ReactPointerEvent<Element>) => void;
|
||||||
onMoveTransform: (clientX: number, clientY: number, shiftKey?: boolean, altKey?: boolean) => boolean;
|
onMoveTransform: (clientX: number, clientY: number, shiftKey?: boolean, altKey?: boolean) => boolean;
|
||||||
onFinishTransform: (event: ReactPointerEvent<Element>) => void;
|
onFinishTransform: (event: ReactPointerEvent<Element>) => void;
|
||||||
@@ -2659,8 +2674,9 @@ function TransformOverlay({
|
|||||||
x: Math.cos(activeRadians) * 92,
|
x: Math.cos(activeRadians) * 92,
|
||||||
y: Math.sin(activeRadians) * 92,
|
y: Math.sin(activeRadians) * 92,
|
||||||
};
|
};
|
||||||
const plane = box.rotationPlanes[rotationWheelAxis];
|
const pinnedWheel = pinnedRotationWheelView?.axis === rotationWheelAxis ? pinnedRotationWheelView : null;
|
||||||
const wheel = box.rotationWheels[rotationWheelAxis] ?? box.rotationWheel;
|
const plane = pinnedWheel?.plane ?? box.rotationPlanes[rotationWheelAxis];
|
||||||
|
const wheel = pinnedWheel?.wheel ?? box.rotationWheels[rotationWheelAxis] ?? box.rotationWheel;
|
||||||
return (
|
return (
|
||||||
<div className="transform-overlay" aria-hidden="true">
|
<div className="transform-overlay" aria-hidden="true">
|
||||||
{showRotationWheel && wheel && plane ? (
|
{showRotationWheel && wheel && plane ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user