Bug 409818

Summary: For float bit depths, some fraction inputs convert too early, making it impossible to type in some fractions
Product: [Applications] krita Reporter: kram.fama
Component: Color SelectorsAssignee: Jasper <hartog.jas>
Severity: minor CC: ghevan, halla, hartog.jas
Priority: NOR    
Version: 4.2.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description kram.fama 2019-07-15 13:24:05 UTC

In the specific color selector, if you switch to either 16bit or 32bit float color input, you can't put in any fractions that start with 1/6 or 1/8 (other than 1/8 and 1/6 themselves) because as soon as you hit 6 or 8 the result is evaluated. For example, 1/64 can not be put in. As far as I could tell, these two specific families of fractions are the only ones affected.

1. Open new document
2. Find or add Specific Color Selector Dock
3. Change bit depth to 16 or 32 bit float
4. For any of the fields, type in 1/6 or 1/8


The input immediately evaluates to 0,16 or 0,12 respectively


Before conversion, further input should be awaited in case a more complicated expression is desired. For example, 1/7 will not instantly convert and you could type out 1/78 or what ever you like before conversion happens.


 Version: 4.2.2
 Languages: de, en_US
 Hidpi: true


  Version (compiled): 5.12.4
  Version (loaded): 5.12.4

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.17763
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10
Comment 1 vanyossi 2019-07-16 04:44:30 UTC
16bit float
2/64 and 2/84 can be written but 2/34 and 2/78 can't

its possible to write 2/34, but not 2/341
Comment 2 Halla Rempt 2019-08-13 07:36:54 UTC
Hi Jasper,

Are you going to work on this? If so, and if you've got questions, please join the rest of the developers on #krita on irc.freenode.net.
Comment 3 Dmitry Kazakov 2019-09-13 10:02:09 UTC
Git commit 92b37d03c08ffd4ac2fad2c09d3c28124b871b9a by Dmitry Kazakov, on behalf of Jasper Hartog.
Committed on 13/09/2019 at 10:00.
Pushed by dkazakov into branch 'krita/4.2'.

Stop too early converting of fractions of the FloatColorInput

Fix the input field from converting the fractions too early by blocking
the input field from signals from the slider.
The slider would trigger the input with a rounded value which resulted
in the early conversion.

M  +4    -0    libs/widgets/kis_color_input.cpp