maoschanz / maoschanz/drawing

Issues and shortcomings with the rotation process.

Open
#704 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
869
Forks
106
PR merge metrics
No merged PRs in 30d

Description

## Use case

When you press the “Rotate” (Alt + N) key to rotate the entire image while editing it, the options for rotating clockwise, rotating counterclockwise, vertical flipping, and horizontal flipping appear below. The ‘Angle’ text box and the “Angle +” and “Angle -” buttons do not appear.

After pressing the “Rectangular Selection” (Alt + D) key to select the entire image or a portion of it, and then pressing the ‘Rotate’ (Alt + N) key, the “Angle” value box, the Angle + and Angle - buttons, and the options for rotating clockwise, rotating counterclockwise, vertical flip, and horizontal flip appear below.

The Rotate feature should always display the Angle option.

The Rotate feature works with integer values in the angle input field. It does not allow rotation with decimal values. I would like to be able to rotate with greater precision. This is a very important feature for the user experience. We should be able to rotate to two decimal places after the decimal point. For example, 1.48 degrees. Rotating in whole-degree increments is not sufficient. Dividing a plane into 360 degrees isn’t a problem for small images. But it’s a major problem for large images. As the image’s perimeter increases, the linear perimeter increases by 1 degree, so the length of the circumferential movement at the image’s edges increases. This is not a precise adjustment process at all. Therefore, the rotation angle must be adjustable in decimal form. Could you add this feature? Additionally, buttons for increasing and decreasing the decimal value could be added.

There is also another issue that needs to be fixed. When a decimal value is entered for the rotation angle, it rounds it to the nearest whole number. However, if you enter a value with a decimal place (for example, 1.5 degrees), it applies the next whole number (for example, entering 1.5 rotates the image by 2 degrees). However, the angle value box displays the previous whole number (for example, the previous whole number for 1.5 is 1. The angle value box should not display 1; it should display 2. But it displays 1.) The angle value box should display the next whole number after rounding. But it displays the previous whole number. Yet it rotates the image by the amount of the next whole number. It does not rotate the image by the previous integer value. (For example, it rotates the image by 2 degrees, not 1 degree. But the value box displays 1 degree, even though it rotates it by 2 degrees.) It is incorrectly rounding decimal numbers to integers.

## Suggested solution

> When editing an image, pressing the “Rotate” (Alt + N) key to rotate the entire image brings up the following options: rotate clockwise, rotate counterclockwise, flip vertically, and flip horizontally. The ‘Angle’ text box and the “Angle +” and “Angle -” buttons do not appear.

> After pressing the “Rectangular Selection” (Alt + D) key to select the entire image or a portion of it, and then pressing the ‘Rotate’ (Alt + N) key, the “Angle” text box, the Angle + and Angle - buttons, and the options for rotating right, rotating left, vertical flip, and horizontal flip appear below.

1. In selected rectangular areas, the “Angle” value box and the Angle + and Angle - buttons appear; similarly, when you press the ‘Rotate’ button without selecting an area in an image, it should also display the “Angle” value box and the Angle + and Angle - buttons.

2. It should correctly round decimal numbers to whole numbers and display the correct value in the value field.

3. It should be possible to enter both decimal and percentage values into the “Angle” text box. Rotation should be possible using both decimal and percentage values as the “Angle” value. I request that this feature be added so that we can perform rotations with a precision of 0.01 degrees.

4. Next to the “+” and “-” buttons for increasing and decreasing the angle, “Decimal,” “Percent,” and ‘Integer’ buttons should also be added. This way, when we want to increase or decrease the values of the “+” and “-” buttons as decimals, percentages, and/or integers—as is currently the case—we can make a selection. For example, if we click the “Decimal” button and then click the “+” button, the angle value should increase by +0.1; if we click the “-” button, it should decrease by -0.1. If we click the ‘Integer’ button and then click the “+” or “-” button, the value should change by +-1. After clicking the “Percentage” button, pressing the “+” or “-” button should add or subtract 0.01. Holding down the “+” and/or “-” buttons should add or subtract the value repeatedly (to speed up the process). This way, we can precisely adjust the angle value in the input field using the buttons. Alternatively, let’s be able to make precise adjustments by directly entering a decimal percentage value into the angle field. Both options are useful for other applications. Both options should be available.

### Possible drawbacks

It fixes problems. It doesn't create new ones.

### Possible alternatives

No.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the Rotate (Alt + N) behavior with and without a Rectangular Selection (Alt + D), then trace the existing rotation controls and angle handling. Done means the angle controls appear in both cases, decimal input is handled consistently, and the displayed value matches the applied rotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.