Bug 334078

Summary: Bad Width/Height unit recalculation
Product: [Applications] krita Reporter: Chris Cotish <dirxteam>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 2.8.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Other   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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