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

Offset between canvas coordinates & aladin coordinates #65

Open
lsacienne opened this issue Nov 21, 2022 · 0 comments
Open

Offset between canvas coordinates & aladin coordinates #65

lsacienne opened this issue Nov 21, 2022 · 0 comments
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@lsacienne
Copy link

lsacienne commented Nov 21, 2022

Bug about the coordinates

There is a small offset created when going from Edition Mode (Javascript Canvas) to Browse Mode (On an aladin light layer). This offset is approximately of 1 pixel in x and y on the canvas.

Illustration

Edition Mode Browse Mode
image image

Cause

The problem probably comes from an approximation made to switch between a floating coordinate system ( in the sky coordinates system ) and the integer coordinate system used by the canvas. The conversion is not precise enough to ensure that the aladin lite background will fit with the canvas.

Potential solutions

  • The first solution that comes to my mind is to use floor and ceiling functions inside the world2pixand pix2world methods. So we can maybe wrap those functions and use ceiling or floor to determine the better conversion.
  • A second solution could be to increase the canvas resolution (if it possible) to have a better precision and a smaller offset
@lsacienne lsacienne added bug Something isn't working invalid This doesn't seem right labels Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant