Bug 430165

Summary: When working on a vector layer and applying a colour gradient to a line and manually moving the direction arrow (or vector) from the gradient, if the layer is exported as .SVG then the exported result is blank.
Product: [Applications] krita Reporter: Víctor <victorleoncontreras>
Component: Layers/VectorAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard
Priority: NOR    
Version First Reported In: 4.4.1   
Target Milestone: ---   
Platform: Snap   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: The steps to reproduce are recorded using krita for Linux (Snap)

Description Víctor 2020-12-08 20:04:48 UTC
Created attachment 133938 [details]
The steps to reproduce are recorded using krita for Linux (Snap)

SUMMARY

When working on a vector layer and applying a colour gradient to a line and manually moving the direction arrow (or vector) from the gradient, if the layer is exported as .SVG then the exported result is blank. 

STEPS TO REPRODUCE
1. Add new vector layer
2. Draw a line
3. Apply a colour gradient (any)
4. Move the arrow of the gradient direction
5. Layer > Import/Export > Save layer as .SVG
6. Blank final result

OBSERVED RESULT

The exported vector layer is blank.

EXPECTED RESULT

The line with the colour gradient should appear in the exported result. 

SOFTWARE/OS VERSIONS

macOS: Y
Linux/KDE Plasma: Y

ADDITIONAL INFORMATION
Comment 1 Ahab Greybeard 2020-12-11 11:12:30 UTC
I can confirm this for the 4.3.0 and 4.4.2-beta-1 appimages.
As noted, it happens when you adjust the gradient start and end point handles.

The resulting .svg file does not display in an .svg capable file viewer but if it's Imported back into krita then it looks ok.

If the .svg file is opened in Inkscape, the image is blank but the line fill gradient control handles seem to be in the correct location. If you set the line fill to solid colour then the vector object is there.

A similar vector object, created in Inkscape, with a rotated gradient line fill, then passed to krita via an .svg file has very offset start and end points on the gradient control line.

Setting to Confirmed.
Comment 2 sh_zam 2021-05-20 20:50:34 UTC
Git commit d7911d93ccddb5759135261e46ffaa0b483110cf by Sharaf Zaman.
Committed on 20/05/2021 at 20:45.
Pushed by szaman into branch 'master'.

Bugfix: Stroke Gradient becomes invisible if edited

We set opacity of Stroke Fills to 0 when editing making them invisible.
Currently there is no way to change opacity of a stroke as whole (which
are filled with gradient).

M  +3    -2    libs/flake/svg/SvgStyleWriter.cpp

https://invent.kde.org/graphics/krita/commit/d7911d93ccddb5759135261e46ffaa0b483110cf