2

Not sure I am asking this correctly. Here's my problem,

Originally, I perform 'Object' --> 'Clip' --> 'Set' on 2 images.

Here's the result:

enter image description here

Note that the pink color object is successfully contained inside the black object. But this is the case when the black object has no stroke/border.

Now, what i want to do, is to apply a border on the black object. If i do so, this happens:

enter image description here

Now, as observed, after applying a border/stroke, the pink object inside becomes mis-aligned. Why it isn't contained inside the black object anymore?

2

The red part does not change its position. The problem here is that svg strokes are centered on the object outline. If you have a stroke of width 8px, 4px of that stroke will overlap the object and the other 4px of the stroke will increase the object size. The following animation shows how the stroke is placed.

svg stroke placement

To get an outline that does not overlap your black object

  • Duplicate the black object (select and ctrl+d).
  • Set a stroke on the duplicate. The stroke should be twice as wide as intended.
  • Put the stroke into the background (select and end).

Alternatively, disable the fill of the duplicate and move it to the front (select and Pos 1).

  • As of Inkscape v0.91, if you add paint-order:stroke fill; to the object's style property, then it will render the fill in front of the stroke. I think v0.92 also adds a GUI option. – mwfearnley Feb 22 '18 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.