Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGraphics.Element middle position can be off by one pixel due to rounding #59
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
evancz
May 11, 2016
Member
Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there. I'm hoping this will make it easier to get help on stuff like this!
|
Sorry this did not get attention til now! The |
evancz
closed this
May 11, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
parkermalenke commentedDec 19, 2014
Hello,
Just started playing around with Elm and am finding it very impressive! Keep up the great work.
I noticed that in certain cases attempting to position an element in the middle of another element results in a layout that is off by a single pixel. I believe this is because line 241 and 236 in the source javascript are using the
bitwise orto round towards a single pixel instead of something likeMath.round().For a reproduction see this example which should draw a red rectangle with a single pixel border all the way around, but instead draws it with a 2px border at the top and left only.
On an unrelated note, I noticed P, Z, and N seem to refer to different methods of setting an axis origin for positioning. This terminology is unfamiliar to me and I would be interested to know what it refers to.