winleafs/Winleafs

Screen mirror needs horizontal flip option

Closed this issue · 4 comments

Hey Winleafs folks,

I've got a set of Aurora panels behind me as well as in front of me, and I'd rather set them both on Screen Mirror rather than having the one behind me on Ambilight (screen mirror is more dramatic!). However, the panel behind me would need to be flipped left-to-right for this to look right, since I'd like it to cast light to the same side of the room as the image on screen.

I think this can be implemented by adding two new scaling modes (Stretch-Flipped, Fit-Flipped) to the panel model and adding new ScaleTransform options in PanelLayout.GetScaledPolygons with a negative X value. But if the center point isn't 0,0, that's also going to create an offset that cheerfully throws all the regions off-screen. I'm terrible at geometry and I don't currently have a working C# compilation environment (I last wrote C# over 9 years ago), so I can't write this patch myself.

Could y'all consider this feature request?

Thanks!

Hey, great idea! I think we should add vertical flip as well, while we are at it. I think I will have some time this week.

Let me explain the basic geometry behind this, just so you can understand it:
Lets say the total width and height is 100 and there is a panel with a top-left coordinate of (10, 10). To flip it horizontally, you simply need to transform each X coordinate with width - X. In this case: 100 - 10 = 90. So its new coordinate, now its top right coordinate, is (90, 10). The same idea applies to flipping it vertically.

This works since we only have positive coordinates.

It's working great - thanks for the update!