Advertisement


Inkscape How to create outer border after Clip 'Set'?


Question

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?

2016/10/09
1
2
10/9/2016 2:26:00 PM

Accepted Answer

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).

2016/10/10
2
10/10/2016 9:13:00 PM