@@ -185,6 +185,21 @@ protected virtual void MouseDown(object sender, MouseButtonEventArgs mouseButton
185185 {
186186 if ( ! IsValidNode ) return ;
187187
188+ // Skip processing if user is panning or orbiting the camera.
189+ // This prevents the manipulator from capturing mouse events intended for camera navigation.
190+ if ( BackgroundPreviewViewModel is DefaultWatch3DViewModel viewModel )
191+ {
192+ if ( viewModel . IsPanning || viewModel . IsOrbiting )
193+ return ;
194+ }
195+
196+ // Only process left mouse button presses for gizmo manipulation
197+ // Right/middle button presses are for camera navigation (pan/orbit)
198+ if ( mouseButtonEventArgs . ChangedButton != MouseButton . Left )
199+ {
200+ return ;
201+ }
202+
188203 active = UpdatePosition ( ) ;
189204 if ( Origin != null )
190205 {
@@ -228,6 +243,21 @@ protected virtual void MouseDown(object sender, MouseButtonEventArgs mouseButton
228243 /// <param name="e"></param>
229244 protected virtual void MouseUp ( object sender , MouseButtonEventArgs e )
230245 {
246+ // Skip processing if user is panning or orbiting the camera.
247+ // This prevents the manipulator from capturing mouse events intended for camera navigation.
248+ if ( BackgroundPreviewViewModel is DefaultWatch3DViewModel viewModel )
249+ {
250+ if ( viewModel . IsPanning || viewModel . IsOrbiting )
251+ return ;
252+ }
253+
254+ // Only process left mouse button releases for gizmo manipulation
255+ // Right/middle button releases are for camera navigation (pan/orbit)
256+ if ( e . ChangedButton != MouseButton . Left )
257+ {
258+ return ;
259+ }
260+
231261 GizmoInAction = null ;
232262
233263 if ( originBeforeMove != null && originAfterMove != null )
@@ -249,6 +279,13 @@ protected virtual void MouseUp(object sender, MouseButtonEventArgs e)
249279 foreach ( var gizmo in gizmos )
250280 {
251281 gizmo . UpdateGizmoGraphics ( ) ;
282+
283+ // Clear hit state to prevent drift during subsequent camera operations
284+ // This ensures stale axis/plane hit data doesn't affect pan/orbit movements
285+ if ( gizmo is TranslationGizmo translationGizmo )
286+ {
287+ translationGizmo . ClearHitState ( ) ;
288+ }
252289 }
253290 }
254291
0 commit comments