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

non-integer zoom has weird rendering #53

Open
nopeless opened this issue Mar 21, 2022 · 1 comment
Open

non-integer zoom has weird rendering #53

nopeless opened this issue Mar 21, 2022 · 1 comment

Comments

@nopeless
Copy link

I haven't looked at the code but setting the zoom to something like 1.01 will create this weird black mask in empty tiles.

Also the scale of zoom 1 is vastly different from 1.01 and 0.99

@nopeless
Copy link
Author

def translate_point(self, point: Vector2D) -> Vector2DInt:
"""
Translate world coordinates and return screen coordinates.
Args:
point: point to translate
"""
mx, my = self.get_center_offset()
if self._zoom_level == 1.0:
return int(point[0] + mx), int(point[1] + my)
else:
return (
int(round((point[0] + mx)) * self._real_ratio_x),
int(round((point[1] + my) * self._real_ratio_y))
)

Most likely caused because of this

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

No branches or pull requests

1 participant