@@ -61,9 +61,7 @@ import { createSceneLink, getRootSceneLink } from "../../tools/scene/scene-link"
6161import {
6262 gizmoSnapMinStep ,
6363 IGizmoSnapPreferences ,
64- loadGizmoSnapPreferences ,
6564 roundGizmoSnapSteps ,
66- saveGizmoSnapPreferences ,
6765} from "../../tools/gizmo-snap-preferences" ;
6866import { UniqueNumber , waitNextAnimationFrame , waitUntil } from "../../tools/tools" ;
6967import { isSprite , isSpriteManagerNode , isSpriteMapNode } from "../../tools/guards/sprites" ;
@@ -206,7 +204,7 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
206204 playEnabled : false ,
207205 playSceneLoadingProgress : 0 ,
208206
209- gizmoSnap : loadGizmoSnapPreferences ( ) ,
207+ gizmoSnap : this . props . editor . state . gizmoSnap ,
210208 } ;
211209
212210 ipcRenderer . on ( "gizmo:position" , ( ) => this . setActiveGizmo ( "position" ) ) ;
@@ -892,8 +890,8 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
892890
893891 private _commitGizmoSnap ( next : IGizmoSnapPreferences ) : void {
894892 const normalized = roundGizmoSnapSteps ( next ) ;
895- saveGizmoSnapPreferences ( normalized ) ;
896893 this . setState ( { gizmoSnap : normalized } ) ;
894+ this . props . editor . setState ( { gizmoSnap : normalized } ) ;
897895 this . gizmo ?. setSnapPreferences ( normalized ) ;
898896 }
899897
@@ -932,7 +930,7 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
932930 inputClassName = "rounded-none border-0 border-l border-input h-9 w-12 px-1 py-0 text-xs bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 !w-12"
933931 title = "Translation snap step (scene units); drag horizontally to adjust (hold Shift for ×10)"
934932 step = { 0.01 }
935- decimals = { 2 }
933+
936934 min = { min }
937935 onChange = { ( v ) => bumpTranslation ( v ) }
938936 />
@@ -959,7 +957,7 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
959957 inputClassName = "rounded-none border-0 border-l border-input h-9 w-12 px-1 py-0 text-xs bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 !w-12"
960958 title = "Rotation snap step (degrees); drag horizontally to adjust (hold Shift for ×10)"
961959 step = { 0.01 }
962- decimals = { 2 }
960+
963961 min = { min }
964962 onChange = { ( v ) => bumpRotation ( v ) }
965963 />
@@ -986,7 +984,7 @@ export class EditorPreview extends Component<IEditorPreviewProps, IEditorPreview
986984 inputClassName = "rounded-none border-0 border-l border-input h-9 w-12 px-1 py-0 text-xs bg-transparent shadow-none focus-visible:ring-0 focus-visible:ring-offset-0 !w-12"
987985 title = "Scale snap step (additive, incremental); drag horizontally to adjust (hold Shift for ×10)"
988986 step = { 0.01 }
989- decimals = { 2 }
987+
990988 min = { min }
991989 onChange = { ( v ) => bumpScale ( v ) }
992990 />
0 commit comments