It is currently October 16th, 2024, 11:25 am

Meters Auto-Adjust to container's height (?)

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 8471
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Meters Auto-Adjust to container's height (?)

Post by Yincognito »

RicardoTM wrote: October 10th, 2024, 8:21 pmWhich that's the downside of this take, a long ass formula lol.
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... ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 366
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Meters Auto-Adjust to container's height (?)

Post by RicardoTM »

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... ;-)
Yah, if something breaks I'll look into it, if nothing breaks then we're fine lol.

I edited my post before you answered (or after?) anyway, only to ask a dumb question:
You used [&Text:H], there's a reason for that? (It works fine with [Text:H])
User avatar
Yincognito
Rainmeter Sage
Posts: 8471
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Meters Auto-Adjust to container's height (?)

Post by Yincognito »

RicardoTM wrote: October 10th, 2024, 8:21 pmA question though, you used [&Text:H], there's a reason for that? (It works fine with [Text:H])
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. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 366
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Meters Auto-Adjust to container's height (?)

Post by RicardoTM »

Yincognito 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. :D
Ah alright. Fortunately this is only for a non dynamic skin. But yah, I agree, consistency looks nicer lol
User avatar
Yincognito
Rainmeter Sage
Posts: 8471
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Meters Auto-Adjust to container's height (?)

Post by Yincognito »

RicardoTM wrote: October 10th, 2024, 8:29 pm Yah, if something breaks I'll look into it, if nothing breaks then we're fine lol.
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.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 366
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Meters Auto-Adjust to container's height (?)

Post by RicardoTM »

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.
Yup, that's breaking tho lol.

Anyway, it works, but for some reason shape meters are kind off position:
Captura de pantalla 2024-10-10 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..

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)
Captura de pantalla 2024-10-10 150510.png
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 8471
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Meters Auto-Adjust to container's height (?)

Post by Yincognito »

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 2024-10-10 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..
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... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 366
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Meters Auto-Adjust to container's height (?)

Post by RicardoTM »

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... :???:
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.
User avatar
Yincognito
Rainmeter Sage
Posts: 8471
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Meters Auto-Adjust to container's height (?)

Post by Yincognito »

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.
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).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
RicardoTM
Posts: 366
Joined: December 28th, 2022, 9:30 pm
Location: México

Re: Meters Auto-Adjust to container's height (?)

Post by RicardoTM »

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).
Yeah I think I"ll round/trunc the formula just to be safe lol.