My Day✳All blog articles ↗

Allow for a centred stroke in visible bounds

A path's geometric width can be smaller than its painted frame.

A stroke centred on a path extends to both sides of it. Path width and painted width therefore differ. This example uses an axis-aligned rectangle without transformations, shadows or markers. Other alignment and effects require their own bounds check; do not transfer the calculation automatically.

Path 100, stroke 10, extension 5 each side, visible width 110 pixels
Path 100, stroke 10, extension 5 each side, visible width 110 pixels

What to do

  1. Check path width, stroke thickness and specifically the centred alignment.
  2. Halve the thickness and add that outward extension on each side.
  3. Leave space beyond both edges, then inspect the exported copy's boundaries.

Example

Fictional frame: a 100-pixel-wide path has a centred 10-pixel stroke. Each side extends outward by 5, so visible width is 100+5+5=110 pixels. A canvas fitted exactly to the 100-pixel path clips the extensions. Allow space on both sides, not only the right.

My Day · Windows

My Day can store dimensions and the export check. You calculate the geometry.

Buy My Day for Windows ↗