Fix mobile rotate button rotating opposite direction - #69
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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
#buttonRotateclick handler to callrotateSelectedComponent()without passing the click event argument, aligning behavior with#selToolRotate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#buttonRotaterotated counter-clockwise while the selection toolbar's#selToolRotaterotated clockwise. Both should rotate clockwise.buttonRotatewas bound via.bind(this), so the clickEventobject was passed as the first argument torotateSelectedComponent(left = false). Since the Event is truthy,leftevaluated to true and rotation went counter-clockwise.#selToolRotateis wired.Bug report: https://bricklayouts.canny.io/feature-requests/p/mobile-rotate-button-is-opposite-of-toolbar
Test plan