Have needed to dynamically switch the anchor position of a skin I'm in the process of making, via the `!SetAnchor` bang, and have noticed more apparently that changing the anchor alignment from the default left edge to the right edge (`R`) this way physically moves the skin by 100% of its width.
This is unexpected behavior for two reasons:
Test case INI:
This has implications for the purposes of say, being able to resize the skin from either edge outward from the opposite edge the mouse is dragging (such resizing can work but since the entire skin position moves first---sometimes offscreen if the anchor changes while at an edge of the screen---it's hardly an expected or pleasant experience when someone has already positioned a skin where they like).
Have tried various workarounds including adding `!Move`/`!SetWindowPosition` bangs but this has unexpected behavior when used with inline formulas and `#CURRENTCONFIGX#`, so haven't found something that can work around this dynamically and wondering what may be possible that I've missed.
The only thing that "worked" in my tests was using `!SetWindowPosition` with a static (fixed) coordinate value that for a right-aligned anchor is offset the same width as the full skin more than the left-aligned static coordinate value (eg: one being `1300` and the other `1000` respectively, assuming a 300px width skin). This obviously isn't suitable for arbitrary skin positions and dynamic skin widths but shows the principle in theory would work if one could get something like `#CURRENTCONFIGX#` working with it properly.
This is unexpected behavior for two reasons:
- It doesn't behave this way when a skin has the Position>From Right option changed via the context menu settings for the skin (that is, the physical position of the skin doesn't move when toggled). Also, not sure if it's a bug, or I'm misunderstanding whether the two things are equivalent, but using `!SetAnchor` with a right (`R`) align value doesn't auto mark that context menu setting (it's independent of whatever state set by bangs).
- In all image editors I've used, along with in CSS, setting a different alignment anchor/transform origin point doesn't move the original element but only adjusts where an element is scaled from. I'm not familiar with any different point of reference that behaves like Rainmeter's way of handling the switching on anchor via bangs.
Test case INI:
Have tried various workarounds including adding `!Move`/`!SetWindowPosition` bangs but this has unexpected behavior when used with inline formulas and `#CURRENTCONFIGX#`, so haven't found something that can work around this dynamically and wondering what may be possible that I've missed.
The only thing that "worked" in my tests was using `!SetWindowPosition` with a static (fixed) coordinate value that for a right-aligned anchor is offset the same width as the full skin more than the left-aligned static coordinate value (eg: one being `1300` and the other `1000` respectively, assuming a 300px width skin). This obviously isn't suitable for arbitrary skin positions and dynamic skin widths but shows the principle in theory would work if one could get something like `#CURRENTCONFIGX#` working with it properly.
Statistics: Posted by Crest — Today, 8:07 am — Replies 14 — Views 228