andymchugh / andrewbmchugh-flow-panel

Apache License 2.0
34 stars 2 forks source link

fill level #59

Closed andymchugh closed 4 months ago

andymchugh commented 4 months ago

This adds a drive for fill-level. See changelog for overview.

Where a fillLevel drive is defined, supported element types of circle, ellipse, rect, path are searched for in the id tree. Where found they are cloned with the clone fill being made transparent. The clone then provides the unclipped background stroke image.

In the original, the bounding rectangle is then determined. With the simple shapes that's just a question of copy/pasting the dimensions. For 'path', it transforms the path syntax into a space-delimited form and then walks the path adjusting the box based off of all start/end/control points. This won't allow for curves going outside of the control points but makes a good approximation for all normal 'vessel' style shapes.

A rect for this bounding box is then added as a clip-path for the original and this rect is then driven dynamically based off of the yaml.