Bug 496262

Summary: Resize canvas dialogue initially set to px and has decimal places
Product: [Applications] krita Reporter: Paul Stenning <paul>
Component: UsabilityAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: dimula73, paul, vitamorus.art
Priority: NOR    
Version: 5.2.6   
Target Milestone: ---   
Platform: Mint (Debian based)   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Paul Stenning 2024-11-14 10:46:35 UTC
SUMMARY
When initially opening the "Resize Canvas" dialogue if the units are "px" (because that's what I used previously) the numerical fields still have two decimal places which is not possible for pixels. If I change the units to "%" or something else then back to "px" the relevant field has no decimal places as expected.

STEPS TO REPRODUCE
1. Open an image
2. Open the "Resize Canvas" dialogue, set all the units to "px", change or more of the numbers and click OK.
3. Open the "Resize Canvas" dialogue again and note that the numerical fields have two decimal places.
4. Change one of the units to "%" then back to "px" and note that the relevant numerical field changed to no decimal places.

OBSERVED RESULT
When initially opening the dialogue, if the units are "px", the relevant numerical field has two decimal places.

EXPECTED RESULT
When initially opening the dialogue, if the units are "px", the relevant numerical field should have no decimal places.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux Mint Debian Edition 6
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
The "Scale to New Size" works as expected so is a good example of how I'd expect the "Resize Canvas" dialogue to behave with different initial units.

I am aware that this is a very trivial issue.
Comment 1 Vitamorus 2024-11-14 11:32:15 UTC
Verifying that this is happening to me as well, thank you for the report Paul!
Comment 2 Dmitry Kazakov 2024-11-14 11:54:51 UTC
Okay, the bug is present in 5.2 branch only, since it has been fixed in this MR by Grum:

https://invent.kde.org/graphics/krita/-/merge_requests/2199

I will try to cheery-pick it into the stable branch now.
Comment 3 Dmitry Kazakov 2024-11-14 11:57:56 UTC
The bug should now be fixed in the stable branch! Thank you for the report! :)

https://invent.kde.org/graphics/krita/-/commit/04ae1472f1d1837cd985685d10ad24991059ce8e
Comment 4 Paul Stenning 2024-11-14 16:18:59 UTC
That's brilliant, thank you for fixing it so quickly. I use Krita as an image editor (Photoshop Elements replacement) for website product images so I use "Resize Canvas" and "Scale to New Size" a lot.