Active Colors wrote: ↑July 26th, 2020, 1:10 pm
All right. For many years I perceived !Redraw as some "standard" to verify that the skin is properly showing up after all the changes made into the skin. But this time it looks other way around. Still, I can't so far deny that there is no mistake made in my skin, I need to further check it. And meanwhile I will use what you suggested. Thanks again, jsmorley!
The skin will always redraw at the very end of every update cycle. The purpose of the !Redraw bang is to have some visible change happen "right now", without waiting up to Update milliseconds for the next natural redraw. However, there is just no point in doing !Redraw if you don't also have some change to something visible. You will always use !Redraw in combination with one or more !UpdateMeter bangs.
That's all sorta beside the point in this case...
Again, the order of events in a skin's update cycle is:
- Update all measures in the order they are in the skin.
- Update all meters in the order they are in the skin.
- Redraw the skin window.
The purpose of your measure, presumably, is to account for the fact that a meter you are using as a "background", which must come before other "foreground" meters in the .ini file, is using the size of the meters that come after it to determine its size. In the natural order of things, that background meter will always be "one update behind", since it is asking "how big are you other guys?" before they are themselves updated.
So the new order of things, with that action in place is:
- The update cycle will update all measures, with that final measure being last. That measure will "force" an immediate update of all meters. At this point, that background meter is still "wrong", since it will still be updated first, before all the others. A redraw has not yet been done, so this doesn't matter. At the end of this all the other meters are fully updated with current measure values applied.
Since the background meter is still "wrong", you do NOT want a !Redraw bang here. It's too soon.
- The update cycle will update all meters. At this point the background meter will now properly "know" the values of the meters after it, and will be "right".
- The update cycle will redraw the skin window.
Chew on that last bit. It's the reason why you are still getting the "chopped off" effect when you include a !Redraw bang in your measure. What you really want to do is to update all meters "twice", to ensure that the background meter has the current values for the meters after it in the skin, THEN let the skin redraw the window naturally.
Extra Credit:
If you really want to fine tune this, although I don't see that it is going to be of much value except perhaps in a skin with a TON of meters, you can use "groups" to target the extra meter updates a bit...
Code: Select all
[UpdateBackgroundLast]
Measure=Calc
OnUpdateAction=[!UpdateMeterGroup "ForegroundMeters"][!UpdateMeter "BackgroundMeter"]