Bug 334078 - Bad Width/Height unit recalculation
Summary: Bad Width/Height unit recalculation
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 2.8.2
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-29 13:07 UTC by Chris Cotish
Modified: 2019-09-05 08:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cotish 2014-04-29 13:07:18 UTC
Width and height are wrongly recalculated between units.

Reproducible: Always

Steps to Reproduce:
1. Select Predefined Size (A4 300dpi)
2. Change Width unit from Pixels about 20 times to a different one.
3. You 'may' end up with Pixel value (2480) displayed as Centimeters (2480,00).
Actual Results:  
Width and height are wrongly recalculated between units.

Expected Results:  
Proper recalculation

It happens from time to time, if you do it fast and between different units.

I'd suggest keeping a single variable that corresponds to just a single unit in memory and do the conversion on it, instead of doing the convertion on the text-area itself.
Comment 1 Halla Rempt 2014-05-03 09:20:30 UTC
I can't click fast enough... We actually keep the size in points internally, and all the rest is calculated from it.
Comment 2 Chris Cotish 2014-05-03 09:31:36 UTC
Found out what the the real cause is. It was not the clicking, but switching the orientation - It does not swap the unit when you change the orientation,

http://imgur.com/MzSRaSj
Comment 3 Halla Rempt 2014-05-03 09:40:45 UTC
Git commit e78ebca5ff6f171c6c9b860c7494e51b417307e7 by Boudewijn Rempt.
Committed on 03/05/2014 at 09:40.
Pushed by rempt into branch 'master'.

M  +17   -1    krita/ui/widgets/kis_custom_image_widget.cc

http://commits.kde.org/calligra/e78ebca5ff6f171c6c9b860c7494e51b417307e7
Comment 4 Halla Rempt 2014-05-03 09:41:48 UTC
Git commit dbb1385a1f591a6afcc83cf7b914dbb15ee3c460 by Boudewijn Rempt.
Committed on 03/05/2014 at 09:40.
Pushed by rempt into branch 'calligra/2.8'.

M  +17   -1    krita/ui/widgets/kis_custom_image_widget.cc

http://commits.kde.org/calligra/dbb1385a1f591a6afcc83cf7b914dbb15ee3c460