Skip to content

Pixel coordinate calculation #145

Answered by Chlumsky
Aquachains asked this question in Q&A
Discussion options

You must be logged in to vote

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:

  • L: round(1*2.75+1-0.5*2) = round(2.75) = 3
  • B: round(1*0+1-0.5*2) = round(0) = 0
  • R: round(1*5.34375+1+0.5*2) = round(7.34375) = 7, therefore width = 7-3 = 4
  • T: round(1*24.3125+1+0.5*2) = round(26.3125) = 26, threfore height = 26-0 = 26

This could be wrong though, I didn't really check it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Aquachains
Comment options

Answer selected by Aquachains
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants