Skip to content

Fix mobile rotate button rotating opposite direction - #69

Merged
jrupp merged 1 commit into
mainfrom
fix-mobile-rotate-direction
Jul 12, 2026
Merged

Fix mobile rotate button rotating opposite direction#69
jrupp merged 1 commit into
mainfrom
fix-mobile-rotate-direction

Conversation

@jrupp

@jrupp jrupp commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • On mobile, tapping #buttonRotate rotated counter-clockwise while the selection toolbar's #selToolRotate rotated clockwise. Both should rotate clockwise.
  • Root cause: buttonRotate was bound via .bind(this), so the click Event object was passed as the first argument to rotateSelectedComponent(left = false). Since the Event is truthy, left evaluated to true and rotation went counter-clockwise.
  • Fix: wrap in an arrow function so no argument is passed, matching how #selToolRotate is wired.

Bug report: https://bricklayouts.canny.io/feature-requests/p/mobile-rotate-button-is-opposite-of-toolbar

Test plan

  • Full spec suite passes (1038 specs, 0 failures)
  • Verify on mobile that tapping the toolbar rotate button rotates clockwise
  • Verify the selection toolbar rotate still rotates clockwise

The mobile toolbar's buttonRotate was bound via .bind(this), passing
the click Event as the first argument to rotateSelectedComponent(left).
Since the Event object is truthy, this triggered counter-clockwise
rotation instead of the intended clockwise. Wrap in an arrow function
so no argument is passed, matching the selection toolbar behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an input-wiring bug in LayoutController where the mobile rotate button rotated in the opposite direction from the selection toolbar rotate action due to the click Event being unintentionally passed as the left argument.

Changes:

  • Update #buttonRotate click handler to call rotateSelectedComponent() without passing the click event argument, aligning behavior with #selToolRotate.

@jrupp
jrupp merged commit bec32fb into main Jul 12, 2026
5 checks passed
@jrupp
jrupp deleted the fix-mobile-rotate-direction branch July 12, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants