patterns handling

Bug #879063 reported by Mihai Sorin Dobrescu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

Hello,

I think there is room for improvement regarding patterns handling.
The pattern behavior should not be document related, but per shape.
It would be natural to have it as in the gradient case. This could make patterns scalable, and positionable related to shape's edges.
Several shapes might need different pattern (or even texture) positioning in the same document.

Thank you.

su_v (suv-lp)
tags: added: transformations
removed: handling position rotate scale translate
Revision history for this message
su_v (suv-lp) wrote :

> The pattern behavior should not be document related, but per shape.
> It would be natural to have it as in the gradient case.
> This could make patterns scalable, and positionable related to shape's edges.

That's actually how it works in Inkscape: If you assign a stock or a custom pattern to an object, it is
- scalable
- transforms with the object (unless you intentionally turned this setting off)
- is object- not document-related.

> Several shapes might need different pattern (or even texture) positioning in the same document.

I don't understand why it should not be possible in Inkscape.

See also:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html#Attributes-Patterns>

Revision history for this message
Mihai Sorin Dobrescu (msdobrescu-gmail) wrote :

OK, my bad.
Let's elaborate.

In my case, I've found some Inkscape settings: transform gradients, transform patterns.
It would be useful to have these customizable per shape.

I might have misunderstood some features though, so ....

Let's open the attachment.
I've created the path in a.svg.
To get the b.svg, I've selected the path in a.svg and converted it to pattern, then I've created a rectangle and assigned the pattern to it.
The result dissatisfies me because the pattern is not "synchronized", i.e. it doesn't start as a tile in the right (correct) corner (i.e. left-top corner, or any chosen corner - this would be a feature request).
First, I've tried to resize the shape. I've noticed the pattern is scaled instead, with the shape, so I have deactivated Inkscape's option for pattern transforming. Then, I could align the pattern with the shape, but would break other patterns too. (in my sample I have none though).
I guess that, at the time of applying a pattern, it is computed as the current settings are, and closing and reopening Inkscape will keep the last "settings" for a shape (in the same document, of course).
I guess there is no way to rotate the pattern inside a shape or closed path, or how to move it in one direction - this would be another feature request. This would definitely be useful.

I am sorry if I am an ignorant regarding pattern handling in Inkscape.

So, why not:
- define shapes' patterns on a per shape methodology
- be able to set if the pattern is synchronized with the shape's chosen corner
- to scale, translate and orient the assigned shape's pattern using an editor similar to gradient tool ?

My apologies for being obscure in the first place.
I DO appreciate your efforts.

Regards,
Mike

Revision history for this message
su_v (suv-lp) wrote :

> So, why not:
> - define shapes' patterns on a per shape methodology

An individual pattern itself (as listed in the fill&stroke dialog) is defined once in the document (like with gradients), but - if the position, scale and/or rotation of the pattern has been modified for that specific object - each instance (an object filled or stroked with such a pattern) references a 'private' pattern definition which holds object-related transformations to be applied to the shared pattern definition and a reference to the shared pattern definition itself. Overall, it works for patterns the same way as for gradients.

> - be able to set if the pattern is synchronized with the shape's chosen corner
> - to scale, translate and orient the assigned shape's pattern using an editor similar to gradient tool ?

Please read the manual page section I linked to in my earlier comment - patterns already can be scaled, rotated and moved freely with its pattern handles:
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Attributes-Fill-Stroke.html#Attributes-Patterns-Adjusting>

Note I: As mentioned in the manual the pattern «handles will appear on the original objects that defined the Pattern, or the former location of those objects if they have been moved or deleted (unless the Pattern has been previously adjusted). In the case of built-on Patterns they will appear in the upper-left corner of the canvas.»
-> you might have to zoom out to actually see the pattern handles at the original position (also for custom patterns).

Note II: Pattern handles can be snapped to grid and guides (but not to other path or bbox snap targets): if you create guides e.g. snapped to the corners of a pattern-filled rectangle, you can adjust the patterns' upper left corner precisely to the upper left corner of the rectangle, and scale the pattern by adjusting the lower right handle (with snapping) so that a single pattern repetition precisely fills the rectangle.

Revision history for this message
Mihai Sorin Dobrescu (msdobrescu-gmail) wrote :

In my case the handles do not appear, so I guess this is the reason of the confusion.
I use Inkscape 0.48.2 r9819 on Windows 7 Enterprise 64 bit.

Revision history for this message
Mihai Sorin Dobrescu (msdobrescu-gmail) wrote :

OK, seems that your primary nightly build storage is down.
I've managed to get the latest nightly build, it works as expected, but I would expect to have the handles in or around the object that has a pattern, and not somewhere else on the document.
Is it possible to have skew too?
I still think that Inkscape option to have or not transformable patterns is redundant, but it doesn't bother me.

Revision history for this message
Mihai Sorin Dobrescu (msdobrescu-gmail) wrote :

Further, testing pattern adjustment, I have set pattern not to be transformed with the shape.
When I resize the shape, the pattern is transformed until I finish the shape resizing.
Then the pattern comes back to its original shape and this makes hard to estimate the right shape size compared to the pattern appearance.
I would prefer to resize the shape and the pattern to keep its original shape in this case (when patttern transformation is disabled).

Revision history for this message
su_v (suv-lp) wrote :

> In my case the handles do not appear, so I guess this is the
> reason of the confusion.
> I use Inkscape 0.48.2 r9819 on Windows 7 Enterprise 64 bit.

Did you actually zoom out, as recommended? (see attached screenshot in Inkscape 0.48.2).

Maybe I should also have mentioned that the pattern handles only appear after having switched tools at least once after creating it:
Bug #686568 “Pattern nodes are not visible in node editor when assigning new pattern”
<https://bugs.launchpad.net/inkscape/+bug/686568>

> OK, seems that your primary nightly build storage is down.

see <http://old.nabble.com/Modevia---Nightlies-to32411463.html>

> I've managed to get the latest nightly build, it works as expected

You should not have to "resort" to unstable development builds just to have the pattern handles appear - the feature works in the stable releases as described. If you keep a recent development version installed, please don't forget to mention which version you are using when describing a possible bug, a regression or lack of feature.

> but I would expect to have the handles in or around the object
> that has a pattern, and not somewhere else on the document.

Needs further investigation… (possibly 'userSpaceOnUse' vs 'objectBoundingBox' - AFAIU Inkscape currently only supports 'patternUnits="userSpaceOnUse"' in pattern definitions).

> Is it possible to have skew too?

No, not with the current implementation.

> Further, testing pattern adjustment, I have set pattern
> not to be transformed with the shape.
> When I resize the shape, the pattern is transformed until
> I finish the shape resizing.
> Then the pattern comes back to its original shape and this
> makes hard to estimate the right shape size compared to
> the pattern appearance.

Known issue, same with the other 'Affects:' options, tracked in
Bug #165727 in Inkscape: “display is wrong when transforming by mouse”
<https://bugs.launchpad.net/inkscape/+bug/165727>

Alternatively, you can always edit the geometry of the object (with the rectangle tool, or the node tool, or what shape tool applies), instead of transforming (scaling, stretching or squeezing) the current selection. Editing the geometry of the object will not affect the pattern scaling or position (unlike the transformations with the select tool).

Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
Mihai Sorin Dobrescu (msdobrescu-gmail) wrote :

You are, of course, right.
I use Inkscape 0.48.2 r9819 on Windows 7 Enterprise 64 bit.
I have re-installed it and works now. It might get corrupted on my drive.
On my b.svg, it still display the handles far away from the original pattern source.
But could move them at least.

BTW, there are several alternative gtk Windows builds on the Internet that behave differently and affect all the gtk-based apps.
You should recommend one of them, to rely on. This way, we could have common expectations.

The skew operation is a powerful feature, so please add it to the list of wishes.

Thank you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.