Bug 407683 - Vector Object Line Style propogates to other objects
Summary: Vector Object Line Style propogates to other objects
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Vector (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-18 09:55 UTC by Ahab Greybeard
Modified: 2019-05-28 05:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A sample .kra file of vector objects to test with (164.11 KB, application/binary)
2019-05-18 09:55 UTC, Ahab Greybeard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ahab Greybeard 2019-05-18 09:55:00 UTC
Created attachment 120159 [details]
A sample .kra file of vector objects to test with

SUMMARY

This bug happens in the 4.1.7 appimage and the latest 4.2.0-beta nightly appimage. It happens in recent previous appimages in slightly different ways. The end result is the same. The description below is for the latest nightly appimage.

If a line style is applied to a vector object in a layer, all objects that were created after that object will have the line style applied to them if the image is saved and closed then the file reopened, even though the line style is not present for those other objects in the .kra file.
If the file is reopened and the line style removed from the object, the later objects will still have the line style applied on-screen and they will all have the line style applied to them in a subsequently saved .kra file.
It gets complicated, see Additional Information.

The attached file 'VectorObjects.kra' contains objects that were created in order from left to right and top to bottom. I suggest you make a backup copy of this before doing any work on it.

STEPS TO REPRODUCE
1. Open VectorObjects.kra, select the blue circle then give it a line style of fine dots.
2. Save it and Close it. Examine the .svg layer contents of VectorObjects.kra and note that only the blue circle has stroke-dasharray="{some numbers}" in its properties/parameters.
3. Open VectorObjects.kra and note that all objects after the blue circle have dashed line style. Select the blue circle and change its line style to 'solid'. Note that the following objects still have dashed line style.
4. Save it and Close it. Examine the .svg layer contents of VectorObjects.kra and note that the blue circle no longer has a stroke-dasharray applied but the objects after it all have that stroke-dasharray applied

OBSERVED RESULT
As noted above

EXPECTED RESULT
The 'spreading' of line style should not happen

SOFTWARE/OS VERSIONS
Krita

 Version: 4.2.0-beta (git 4cb9902)
 Languages: en_GB, en
 Hidpi: true

Qt

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

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.9.0-9-amd64
  Pretty Productname: Debian GNU/Linux 9 (stretch)
  Product Type: debian
  Product Version: 9

ADDITIONAL INFORMATUION

This is limited to the layer in which it happens and other layers are not affected.

The process by which this happens has changed in nightly builds over the past few days. Sometimes it shows in on-screen presentation before saving. Sometimes it only shows after saving and reopening.

If a line style of 'null' is selected (the blank space at the top of the line style drop down list) then this is applied but it is not saved in the .kra file and not present after reopening. Also, it can't be exported to a .svg file.

I think that a line style of null is represented by stroke-dasharray="0,0" but I've been unable to create this in krita. It has been observed in a problem file that was discussed in https://forum.kde.org/viewtopic.php?f=139&t=160634 where objects with a null linestyle were causing some vector lines to be invisible by the process described in this report.

I've asked but have not been able to find out if the OP of that topic had imported or pasted vector content from another application.
Comment 1 vanyossi 2019-05-18 16:20:06 UTC
Confirming

This seems to happen on load as the position of the vector shape in the svg spills only to the next shapes listed.
Comment 2 Ahab Greybeard 2019-05-18 19:02:59 UTC
The OP of the forum post has now said that no externally sourced content was used and the original image with the problem was made solely in krita. The problem was caused by some objects having stroke-dasharray="0,0" and this property spread to later vector lines making them invisible.

It may be that I was unable to create this property in a file due to the limited nature of my attempts. It may be that an older 4.2.0 pre-alpha was used at sometime which had this capability.

Either way, the use of a 'null' line style is not needed since a stroke can be made invisible by selecting 'No Fill' in the line option tab of the Tool Options docker, which gives a stroke="none" property.

Inkscape doesn't have a 'null' line style and an attempt to load an object with stroke-dasharray="0,0" gives a solid line and saving this gives stroke-dasharray:none in the svg file. This is very puzzling.
Comment 3 vanyossi 2019-05-28 05:13:16 UTC
Fixed by commit e6b80a85

I did not tag it correctly :/