Bug 394887 - Segment gradient editor sets opacity to 0~1% when a segment gets selected.
Summary: Segment gradient editor sets opacity to 0~1% when a segment gets selected.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.0.3
Platform: unspecified All
: NOR minor
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-31 10:31 UTC by Yemachu
Modified: 2018-06-05 08:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yemachu 2018-05-31 10:31:54 UTC
Steps to reproduce:
 1. Click "Gradients" in the toolbar
 2. In the pop-up, click the button with the triangle pointing down (next to "+ Add...")
 3. From the options, select "Segmented Gradient"
Optional:
 4. Modify the value or leave it as is...
 5. Right click the gradient and select "Split Segment"
 6. Click on the new segment to see the opacity to be 1%.
 7. Click on the old segment to see the opacity to be 1% as well.
 8. Repeat steps 6 and 7 a few times, and the opacity becomes 0% instead.

Actual results:
When the editor window opens, the (segment of the) gradient is shown fully opaque, while the opacity on its "Left" and "Right" are set to 1% (or 0% in case of a low previous value). Switching back and forth between segments 

Expected results:
The initial opacity of the left and right side set to be 100%. When switching between segments, the value should remain unchanged.

Additional Information:
Looking at the code in the repository, the issue seems to stem from either dividing by 100 when the user modifies the value, or by not multiplying it by 100 when a new segment is selected. Found in the file "<PROJECT ROOT>/libs/ui/kis_autogradient.cc", on lines 75, 79, 142, and 155.
Comment 1 Halla Rempt 2018-06-05 08:07:26 UTC
Thanks, good catch and correct suggestion!
Comment 2 Halla Rempt 2018-06-05 08:08:02 UTC
Git commit 807aebf90487716ba39770cacf717071cdc1dc3e by Boudewijn Rempt.
Committed on 05/06/2018 at 08:07.
Pushed by rempt into branch 'krita/4.0'.

Show the correct opacity in the segment gradient editor

M  +2    -2    libs/ui/kis_autogradient.cc

https://commits.kde.org/krita/807aebf90487716ba39770cacf717071cdc1dc3e
Comment 3 Halla Rempt 2018-06-05 08:08:14 UTC
Git commit d58a43e48d61382a3b2240efd69e113365519f59 by Boudewijn Rempt.
Committed on 05/06/2018 at 08:08.
Pushed by rempt into branch 'master'.

Show the correct opacity in the segment gradient editor
(cherry picked from commit 807aebf90487716ba39770cacf717071cdc1dc3e)

M  +2    -2    libs/ui/kis_autogradient.cc

https://commits.kde.org/krita/d58a43e48d61382a3b2240efd69e113365519f59