Bug 408022

Summary: Unstable vector gradient controller on lines with zero width bounding box
Product: [Applications] krita Reporter: Ahab Greybeard <ahab.greybeard>
Component: Tools/VectorAssignee: Krita Bugs <krita-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: griffinvalley
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ahab Greybeard 2019-05-28 10:56:30 UTC
SUMMARY
This bug is present in all versions from 4.1.7 to the latest Nightly krita-4.3.0-prealpha-fc51481-x86_64.appimage	

If a vertical or horizontal vector line is drawn and then selected and its line stroke style edited in the Tool Options docker and then set to Gradient, the yellow gradient controller handles appear.
If the yellow end points are moved at all, they suddenly go to infinity.
This can be recovered by selecting a stroke style of Solid.

If a line that is not vertical or horizontal is drawn, it does not have this bug.
The reason for this (or a related factor) seems to be that the bounding box for a line initially drawn as vertical or horizontal has a zero width bounding box, whereas as an initially non vertical/horizontal line has a bounding box of finite width.
If an intially drawn vertical/horizontal line is rotated, its bounding box is still zero width and so it still exhibits the bug.
If an intially non-vertical/horizontal line is rotated to be horizontal/vertical, it still has a finite bounding box width and so does not exhibit this bug.

STEPS TO REPRODUCE
See Summary

OBSERVED RESULT
See Summary

EXPECTED RESULT
It shouldn't do that.

SOFTWARE/OS VERSIONS
Krita

 Version: 4.3.0-prealpha (git fc51481)
 Languages: en_GB, en
 Hidpi: true

Qt

  Version (compiled): 5.12.2
  Version (loaded): 5.12.2

ADDITIONAL INFORMATION
A workaround for this is to draw a long thin rectangle (instead of a line) and set its stroke to No Fill and its fill to Gradient.
Another (but crude) workaround is to draw an initially non-vertical/horizontal line and then to adjust its bounding box to make it apparently 'zero width', after which it becomes vertical/horizontal and has a well behaved gradient controller.
Comment 1 wolthera 2019-09-21 15:51:45 UTC
I can confirm on KDE Neon with Krita 4.3 pre-alpha.