Skip to content

Commit

Permalink
see last commit (but for module designer)
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w1zard1 committed May 30, 2024
1 parent ff14c13 commit 6815e83
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2185,8 +2185,10 @@ def onMouseMoved(self, screen: Vector2, screenDelta: Vector2, world: Vector2, wo
#self.editor.log.debug("onMouseMoved, screen: %s, screenDelta: %s, world: %s, worldDelta: %s, buttons: %s, keys: %s", screen, screenDelta, world, worldDelta, buttons, keys)
shouldMoveCamera = self.moveCamera.satisfied(buttons, keys)
shouldRotateCamera = self.rotateCamera.satisfied(buttons, keys)
adjustedWorldDelta = worldDelta
if shouldMoveCamera or shouldRotateCamera:
self.renderer.doCursorLock(screen)
adjustedWorldDelta = Vector2(-worldDelta.x, -worldDelta.y)
if shouldMoveCamera:
strength = self.settings.moveCameraSensitivity2d / 100
self.renderer.camera.nudgePosition(-worldDelta.x * strength, -worldDelta.y * strength)
Expand All @@ -2199,15 +2201,15 @@ def onMouseMoved(self, screen: Vector2, screenDelta: Vector2, world: Vector2, wo
if self.moveSelected.satisfied(buttons, keys):
if isinstance(self._mode, _GeometryMode):
RobustRootLogger().debug("Move geometry point %s, %s", worldDelta.x, worldDelta.y)
self._mode.moveSelected(worldDelta.x, worldDelta.y)
self._mode.moveSelected(adjustedWorldDelta.x, adjustedWorldDelta.y)
return

# handle undo/redo for moveSelected.
if not self.editor.isDragMoving:
RobustRootLogger().debug("moveSelected instance in 2d")
self.editor.initialPositions = {instance: instance.position for instance in self.editor.selectedInstances}
self.editor.isDragMoving = True
self.editor.moveSelected(worldDelta.x, worldDelta.y, noUndoStack=True, noZCoord=True)
self.editor.moveSelected(adjustedWorldDelta.x, adjustedWorldDelta.y, noUndoStack=True, noZCoord=True)

if self.rotateSelected.satisfied(buttons, keys) and isinstance(self._mode, _InstanceMode):
if not self.editor.isDragRotating:
Expand Down

0 comments on commit 6815e83

Please sign in to comment.