When I style a logarithmic spiral with a class (defined in the "Selectors and CSS" it behaves weird.
I defined a class with only one property stroke-width. When I assigned a class to different spirals, the stroke width depends on the size of a spiral. Bigger (same shape, called up) spiral is thicker, smaller spiral is thinner. When the stroke width is set Fill ans Stroke | Stroke style, the width works properly, it is exactly as set.
How can I set the spiral stroke width with a class?
Unfortunately works only on a screen. The spiral is displayed with the same size but actual stroke width is different and when printed the size is different.
I don't know about the CSS property "vector-effect: non-scaling-stroke" and how well Inkscape handles it.
So about your original example: when you scale down the spiral, Inkscape keeps the original spiral and creates a transformation matrix for it. The stroke width also gets scaled down since it's set from the CSS class (which Inkscape wouldn't try to change in order to compensate for the transformation like it normally does when it is set from the "stroke style" panel).
I see two workarounds: - scale down the spiral using the spiral tool: (ctrl +) shift + drag the external handle of the spiral to scale it up/down. - apply the transform: select the scaled down spiral, then "extensions > Modify Path > Apply Transform". Doing so however, the spiral will be transformed into a path (it won't be a spiral anymore).
Hi,
When I style a logarithmic spiral with a class (defined in the "Selectors and CSS" it behaves weird.
I defined a class with only one property stroke-width. When I assigned a class to different spirals, the stroke width depends on the size of a spiral. Bigger (same shape, called up) spiral is thicker, smaller spiral is thinner. When the stroke width is set Fill ans Stroke | Stroke style, the width works properly, it is exactly as set.
How can I set the spiral stroke width with a class?
Wojtek
Example file showing the effect
Maybe this?
Thank you. Works.
Unfortunately works only on a screen. The spiral is displayed with the same size but actual stroke width is different and when printed the size is different.
Works here when svg is saved as pdf from Firefox.
I printed mine from Inkscape to a pdf printer. If saved from Inkscape to pdf (Save as ...), the spirals also have different thickness.
I guess there is something about "transform" generated by Inkscape when a spiral is created.
I don't know about the CSS property "vector-effect: non-scaling-stroke" and how well Inkscape handles it.
So about your original example: when you scale down the spiral, Inkscape keeps the original spiral and creates a transformation matrix for it. The stroke width also gets scaled down since it's set from the CSS class (which Inkscape wouldn't try to change in order to compensate for the transformation like it normally does when it is set from the "stroke style" panel).
I see two workarounds:
- scale down the spiral using the spiral tool: (ctrl +) shift + drag the external handle of the spiral to scale it up/down.
- apply the transform: select the scaled down spiral, then "extensions > Modify Path > Apply Transform". Doing so however, the spiral will be transformed into a path (it won't be a spiral anymore).