Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add nominal size support #73

Merged
merged 6 commits into from
Dec 21, 2024
Merged

core: add nominal size support #73

merged 6 commits into from
Dec 21, 2024

Conversation

vaxerski
Copy link
Member

@vaxerski vaxerski commented Dec 18, 2024

Adds support for an additional property (nominal_size) being a float describing what fraction of the destination size this image implies.

Example:

nominal_size = 0.8
define_size = 0, image.svg 

In this case, if the user asks for 32, this image will be treated as 32 / 0.8 = 40.

ref hyprwm/Hyprland#8713

Will need a spec bump.

@vaxerski
Copy link
Member Author

alright, tested and seems to work.

@vaxerski
Copy link
Member Author

merging, I dont see any opposition

@vaxerski vaxerski merged commit 84203d8 into main Dec 21, 2024
4 checks passed
@Covkie
Copy link

Covkie commented Dec 21, 2024

Oops i forgot to comment - but yeah it does work. One question though, are hotspots applied before or after the nominal size scaling?

@vaxerski
Copy link
Member Author

vaxerski commented Dec 21, 2024

hotspots are floats :) I can clarify it in spec (libhyprcursor doesn't do anything to the hotspot value it's just passed through) but they are always from the actual image size.

woops hyprcursor does pass them as ints if you are using rendering, but the rest stands.

hotspot.xy * image.wh

if you have a nominal size of 0.5 on 32x you get a 64x image where hotspot 0.25 0.25 would be 16x16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants