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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug line width depends on zoom #230

Closed
maxammann opened this issue Dec 15, 2022 · 2 comments 路 Fixed by #255
Closed

Debug line width depends on zoom #230

maxammann opened this issue Dec 15, 2022 · 2 comments 路 Fixed by #255
Labels
feature-request Request for a new feature good first issue Good for newcomers

Comments

@maxammann
Copy link
Collaborator

Currently the width of the debug lines depends on the zoom.

馃 Expected Behavior

Lines should always have the same pixel-width on the screen.

馃槸 Current Behavior

The width changes.

馃拋 Possible Solution

Multiply the line width in the debug shader with a scaling factor:
https://github.com/maxammann/maplibre-rs/blob/07bddd2a8c42f0cb906586f01eaaefb94dc34f7a/maplibre/src/render/shaders/tile.vertex.wgsl#L31

@maxammann maxammann added good first issue Good for newcomers feature-request Request for a new feature labels Dec 15, 2022
@jackson211
Copy link
Contributor

Would it be better to draw the line and the tile separately, don't change the width of the line until the tile refreshes? This can avoid recalculation on the line during zooming.

@maxammann
Copy link
Collaborator Author

The lines exist in "world space" that means that lines need to be scaled actually so they take the same amount of pixels independent of zoom.

This task is actually quite simple. We only need to multiply the line width a zoom_fraction which is already calculated in the code.

Tristramg added a commit to Tristramg/maplibre-rs that referenced this issue Feb 18, 2023
maxammann pushed a commit that referenced this issue Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a new feature good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants