https://bugs.kde.org/show_bug.cgi?id=512243
Freya Lupen <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Status|REPORTED |CONFIRMED Ever confirmed|0 |1 --- Comment #4 from Freya Lupen <[email protected]> --- Confirmed with the attached brush. The issue only happens with Smearing mode, even though the mode is set under Smudge Length, which isn't enabled. (Checking the mode when it's disabled seems like a bug too?) The short version is it's a decimal rounding issue that can happen under some circumstances. The long technical explanation: We assert here: > ASSERT (krita): "selBounds.contains(selRect)" in file > /krita/libs/image/kis_painter.cc, line 1057 The values are: > selBounds QRect(0,0 8x8) selRect QRect(0,0 9x9) These values can be seen in a commented-out warning in KisQImagePyramid::calculateParams() as well: > krita.general: WARNING: expected and real dab rects do not coincide! > krita.general: expected rect: QRect(0,0 9x9) > krita.general: real rect: QRect(0,0 8x8) The "expected" rect is based on transforming the original brushtip size (256x256). The "real" rect is based on the transforming the scaled brushtip size's closest size in the pyramid of power-of-2 levels (8x8). The brush has a size curve where 100% tilt elevation is .05 size. But, somehow in KisDynamicSensor::parameter(), the size scale value ends up as 0.05000000000000004. When multiplying that size scale by the scale of the brush preset size to the brushtip size (160/256 = .625), we then end up with a dab scale of 0.03125000000000003 instead of just 0.03125 (8/256). Then the "expected" dab size (dab scale * brushtip size) ends up as 8.000000000000007 instead of 8. That dab size is passed to the roundRect() function, which uses QRectF.toAlignedRect() to round up non-integer rectangles. Since there's that tiny fraction, we end up with an "expected" dab size of 9x9. The "real" dab size is calculated by dividing the "expected" dab scale of 0.03125000000000003 by the scale of the scaled dab to the original brushtip (8/256, .03125). We end of with a "real" dab scale of 1.000000000000001, multipled by the scaled dab size 8 to get a "real" dab size of 8.000000000000000 (or 8.00000000000000008; two more decimals). It's apparently too small for toAlignedRect() to round up, and we get a "real" dab size of 8x8. However, the above dab sizes are all with no transformation applied. If there's subpixel translation, the rects will be rounded up to contain the fractional positions. If the dab is rotated, the transformed dab's size will likely be a large enough fraction to round up with toAlignedRect regardless of whether it's the original or scaled dab. Thus the crash (assert) only happens in Smearing mode, where subpixel precision is disabled, and when the rotation angle happens to be 0. -- You are receiving this mail because: You are watching all bug changes.
