Take care with those integer coordinates of meters too, might worth to apply some Round() or Trunc() in various places, though I'm not sure it would solve it...
It is currently November 4th, 2024, 4:37 am
Meters AutoAdjust to container's height (?)

 Rainmeter Sage
 Posts: 8597
 Joined: February 27th, 2015, 2:38 pm
 Location: Terra Yincognita
Re: Meters AutoAdjust to container's height (?)

 Posts: 436
 Joined: December 28th, 2022, 9:30 pm
 Location: México
Re: Meters AutoAdjust to container's height (?)
Yah, if something breaks I'll look into it, if nothing breaks then we're fine lol.Yincognito wrote: ↑October 10th, 2024, 8:24 pm Take care with those integer coordinates of meters too, might worth to apply some Round() or Trunc() in various places, though I'm not sure it would solve it...
I edited my post before you answered (or after?) anyway, only to ask a dumb question:

 Rainmeter Sage
 Posts: 8597
 Joined: February 27th, 2015, 2:38 pm
 Location: Terra Yincognita
Re: Meters AutoAdjust to container's height (?)
Just to be 1000% sure that those values were the most "current" ones, that's all. And also, to keep consistent with the nested syntax in the sample.

 Posts: 436
 Joined: December 28th, 2022, 9:30 pm
 Location: México
Re: Meters AutoAdjust to container's height (?)
Ah alright. Fortunately this is only for a non dynamic skin. But yah, I agree, consistency looks nicer lolYincognito wrote: ↑October 10th, 2024, 8:29 pm Just to be 1000% sure that those values were the most "current" ones, that's all. And also, to keep consistent with the nested syntax in the sample.

 Rainmeter Sage
 Posts: 8597
 Joined: February 27th, 2015, 2:38 pm
 Location: Terra Yincognita
Re: Meters AutoAdjust to container's height (?)
It's not about breaking. If the division makes the formula give some 7.37 fractional value as the gap, then the 0.37 (or 0.63) part will be lost when positioning the meters.

 Posts: 436
 Joined: December 28th, 2022, 9:30 pm
 Location: México
Re: Meters AutoAdjust to container's height (?)
Yup, that's breaking tho lol.Yincognito wrote: ↑October 10th, 2024, 8:36 pm It's not about breaking. If the division makes the formula give some 7.37 fractional value as the gap, then the 0.37 (or 0.63) part will be lost when positioning the meters.
Anyway, it works, but for some reason shape meters are kind off position:
The text inside the buttons are not taken into account on the formula (since their position is relative to the shapes).
It got trickier, because of course the "R" is taking into account the last meter, which is the text, not the shape..
Edit. Somehow I fixed it by setting the texts H to half the shapes H (?) (I though setting the text heigh to the shape height would do it but nope)
You do not have the required permissions to view the files attached to this post.

 Rainmeter Sage
 Posts: 8597
 Joined: February 27th, 2015, 2:38 pm
 Location: Terra Yincognita
Re: Meters AutoAdjust to container's height (?)
Yeah, I meant the formula / approach will not break. The integer positioning and font spacing at margins though, that's what's "breaking" an otherwise perfectly sound mathematical equality. If meters could be positioned at fractional pixel values (like shapes do, inside a Shape meter), then everything would be as good in practice as it is in theory...RicardoTM wrote: ↑October 10th, 2024, 8:49 pm Yup, that's breaking tho lol.
Anyway, it works, but for some reason shape meters are kind off position:
Captura de pantalla 20241010 144414.png
The text inside the buttons are not taken into account on the formula (since their position is relative to the shapes).
It got trickier, because of course the "R" is taking into account the last meter, which is the text, not the shape..

 Posts: 436
 Joined: December 28th, 2022, 9:30 pm
 Location: México
Re: Meters AutoAdjust to container's height (?)
Yup, that's unfortunate. I noticed it when messing with the example's background height, I had to change it so scrolling would be increments of 5 for it to not look clunky.Yincognito wrote: ↑October 10th, 2024, 9:08 pm Yeah, I meant the formula / approach will not break. The integer positioning and font spacing at margins though, that's what's "breaking" an otherwise perfectly sound mathematical equality. If meters could be positioned at fractional pixel values (like shapes do, inside a Shape meter), then everything would be as good in practice as it is in theory...
Apparently it works just fine for all pages on the tutorial. I'll do more testing along the way anyway.
Thanks for your help Ying, as always.

 Rainmeter Sage
 Posts: 8597
 Joined: February 27th, 2015, 2:38 pm
 Location: Terra Yincognita
Re: Meters AutoAdjust to container's height (?)
No problem, you're welcome.RicardoTM wrote: ↑October 11th, 2024, 4:33 pm Yup, that's unfortunate. I noticed it when messing with the example's background height, I had to change it so scrolling would be increments of 5 for it to not look clunky.
Apparently it works just fine for all pages on the tutorial. I'll do more testing along the way anyway.
Thanks for your help Ying, as always.
Again, you could do some round / trunc Kung Fu to correct this, though it would have to be done right for it to work.
For example, say you have 8 gaps of 7.375 pixels each. You know that the sum of gaps is always an integer, in this case 59, so, if you alternatively use 7 and 8 instead of 7.375, while making sure their sum is always 59, then problem solved. A single pixel up or down in positioning the meters is hardly noticeable, and you'll have the last element always positioned at the very bottom of the "container". This might require moving the Y in the meters in order to round / trunc based on the sum of already used gaps though (e.g. 1st gap = 7 based on rounding 7.375 * 1, 2nd gap = 8 based on rounding 7.375 * 2, 3rd gap = 7 based on rounding 7.375 * 3, 4th gap = 8 based on rounding 7.375 * 4, 5th gap = 7 based on rounding 7.375 * 5, 6th gap = 7 based on rounding 7.375 * 6, 7th gap = 8 based on rounding 7.375 * 7, 8th gap = 7 based on rounding 7.375 * 8).

 Posts: 436
 Joined: December 28th, 2022, 9:30 pm
 Location: México
Re: Meters AutoAdjust to container's height (?)
Yeah I think I"ll round/trunc the formula just to be safe lol.Yincognito wrote: ↑October 12th, 2024, 8:51 am No problem, you're welcome.
Again, you could do some round / trunc Kung Fu to correct this, though it would have to be done right for it to work.
For example, say you have 8 gaps of 7.375 pixels each. You know that the sum of gaps is always an integer, in this case 59, so, if you alternatively use 7 and 8 instead of 7.375, while making sure their sum is always 59, then problem solved. A single pixel up or down in positioning the meters is hardly noticeable, and you'll have the last element always positioned at the very bottom of the "container". This might require moving the Y in the meters in order to round / trunc based on the sum of already used gaps though (e.g. 1st gap = 7 based on rounding 7.375 * 1, 2nd gap = 8 based on rounding 7.375 * 2, 3rd gap = 7 based on rounding 7.375 * 3, 4th gap = 8 based on rounding 7.375 * 4, 5th gap = 7 based on rounding 7.375 * 5, 6th gap = 7 based on rounding 7.375 * 6, 7th gap = 8 based on rounding 7.375 * 7, 8th gap = 7 based on rounding 7.375 * 8).