Vision: Flip SVG using Template Parameter

I was trying to create a template from components that could be flipped / mirrored, but it's not possible to flip a template instance, and its not even possible to flip a component from the pallet.

So... if I make a template that consists of all drawings / SVGs, is it possible to group them, and the flip them inside of the template using a boolean parameter? This would avoid me having to maintain two templates of mirror image.

Hi Seth_Kahle,

What I did was group all the drawings together in the template, and added a template property called Flip of boolean type. I then put an expression binding on the angle property of the group that uses an if statement to see if Flip is enabled and set the angle accordingly. Example:

if({Flip.Flip}, 180, 0)

Angle of 0 and 180 flips horizontally, and 90 and 270 flips vertically. Depending on what the whole group looks like, this may not work how you want it to.

Unfortunately my drawings are not symmetrical, so the rotation makes the shape appear upside down.

I thought I might just put both shapes into one template and then show/hide based on a Boolean parameter, but that’s just as bad as maintaining two templates.

It would technically be possible to do this with a paintable canvas component; you could 'borrow' your other components, and ask them to draw inside the paintable canvas after applying an AffineTransform to rotate everything/flip the axis accordingly. As long as it's an exact flip, it should be more or less pixel perfect, though it will likely be somewhat of a CPU hit.

I don't have any code to share, but that might be enough to get you started.

Would it be acceptable to embed multiple SVGs into the template that are already oriented in the correct manner, then simply show the correct one? A bit hacky and old school, but fairly easy to implement IMO.