Increase StrokeThickness, but keep Path sizes

I have Path, which usually matters StrokeThickness of 1. Under certain circumstances, he needs to have StrokeThickness 10. When I increase the thickness of the stroke, I don’t want the path to take up extra space.

By default, only increasing StrokeThickness increases the displayed path size. So, you get something like this (the blue outline extends beyond the black border):

Stroke expands beyond original boundary of path

This is what I am trying to achieve (the blue outline remains within the black border):

Stroke is entirely inside original boundary of path

I can think of two mathematical ways to compensate for the increased StrokeWidth:

  • Manually adjust the points of the triangle inward.
  • Use scale shape in path geometry.

Both of them would be somewhat problematic / complex. Is there an easier way?

+5
2

:

<Path ... Clip="{Binding Data, RelativeSource={RelativeSource Self}}"/>

StrokeThickness, .

+18

StrokeThickness = -1 , , : , .

0

All Articles