Fix rotate buttons rotating in the wrong direction#369
Open
Darrkop wants to merge 1 commit into
Open
Conversation
The right-rotate button increments rotation by 90 (clockwise intent), but ImageProcessor._apply_rotation mapped it to Image.ROTATE_90, which is Pillow's counter-clockwise 90 degree transpose. Likewise the left button's -90 mapped to ROTATE_270 (clockwise). Swap the two cases so rotating right actually rotates clockwise and rotating left rotates counter-clockwise.
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
ImageSidebarincrementsrotationby+90on rotate-right (clockwise intent) and-90on rotate-left (counter-clockwise intent).ImageProcessor._apply_rotationmappedrotation == 90toImage.ROTATE_90, but Pillow'sROTATE_90transpose is counter-clockwise, andROTATE_270is clockwise — so the two cases were swapped, making both buttons rotate opposite to their intent.ROTATE_90/ROTATE_270cases so rotate-right now rotates clockwise and rotate-left rotates counter-clockwise.Test plan
ROTATE_90moves a marked top-left pixel to the bottom-left (counter-clockwise), confirming the mapping was inverted.