Pixel coordinate calculation #145
Answered
by
Chlumsky
Aquachains
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
Chlumsky
Jan 31, 2022
Replies: 1 comment 1 reply
-
The formula for pixel bounds based on shape bounds and other parameters may potentially be something along
This could be wrong though, I didn't really check it. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Aquachains
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The formula for pixel bounds based on shape bounds and other parameters may potentially be something along
round(scale*bound+translate+-0.5*pxRange)
, so:round(1*2.75+1-0.5*2) = round(2.75) = 3
round(1*0+1-0.5*2) = round(0) = 0
round(1*5.34375+1+0.5*2) = round(7.34375) = 7
, thereforewidth = 7-3 = 4
round(1*24.3125+1+0.5*2) = round(26.3125) = 26
, threforeheight = 26-0 = 26
This could be wrong though, I didn't really check it.