Copy link to clipboard
Copied
sourceRectAtTime method has an includeExtents parameter, that includes the shape layer bounds. This must be the stroke.
I've put this parameter to test and got mixed results. Check this 2 images. Stroke width is 10 (I guess px) in both cases. With includeExtents set to false, width is is 499px. But if set to TRUE, then the width becomes 549px. That is 5x the amount of stroke. What is going on here? Numbers just don't add up. Also I've drawn 2 rulers that prove that width of the stroke is in fact, 10px.
All vector rendering expands beyond the actual visible content to calculate antialiasing and such. Therefore the extended bounding box represents a virtual canvas on which the actual fills are painted, whereas the geometry bounding box encompasses the path. In case of text this would be the difference between the em box used for kerning and so on vs. the actual contours. For shape layers a similar logic applies, though this stuff doesn't seem to be documented anywhere, so the actual extents of a
...Copy link to clipboard
Copied
Extents mean the rendering canvas, not any shape element. The paint canvas always has considerable padding. Since you know the values of your stroke, simply add them in whatever formula you use.
Mylenium
Copy link to clipboard
Copied
Hey Mylenium! Thanks for taking your time. I admit, I am even more confused What is rendering canvas of a layer? What padding, where did it come from? i've never seen any padding added to any layer in AE. Could you add a little more detail to your answer?
Copy link to clipboard
Copied
All vector rendering expands beyond the actual visible content to calculate antialiasing and such. Therefore the extended bounding box represents a virtual canvas on which the actual fills are painted, whereas the geometry bounding box encompasses the path. In case of text this would be the difference between the em box used for kerning and so on vs. the actual contours. For shape layers a similar logic applies, though this stuff doesn't seem to be documented anywhere, so the actual extents of a layer when using this option are never quite clear. It's best not to use it and add your own padding and margins via your code.
Mylenium