[go: up one dir, main page]

Copy/Pasting a shape with a class writes class attribute into objects style

Steps to reproduce:

  • open Inkscape
  • open attached file (rectangle with a css class, setting fill and stroke): test_class_style_stroke.svg
  • copy and paste the rectangle

What happened?

The pasted rectangle has both the class and the style set. The source rectangle only had the class set.

style="fill:#0000ff;stroke:#0000ff;stroke-width:2"
class="bluerectangle"

That's unnecessary.

What should have happened?

The object still has a class set, but not a style with exactly the same information.

This issue could create all sorts of problems with inheritance of styles. I.e. when I change the fill attribute on the class, I expect the pasted object to change the fill as well. This actually happens, but only because changing the attribute on the class deletes the corresponding part of the object's style, which is a separate bug.

Duplicating does not create the redundant style attribute.

Inkscape Version and Operating System:

  • Inkscape Version: 1.1-dev (12e2a095, 2020-02-19)
  • Operating System: Windows 10
  • Operating System version: 10.0.18362