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

Add Gap-Removing Features #161

Merged
merged 4 commits into from
Jan 25, 2025
Merged

Add Gap-Removing Features #161

merged 4 commits into from
Jan 25, 2025

Conversation

NicksWorld
Copy link
Contributor

Due to subpixel scaling, gaps could appear between tiles when zoomed in. This adds two new features which prevent these gaps from appearing.

EXTRUDE_TILES (on by default) expands every sprite by 1px in each direction, preventing gaps with minimal visual difference.

PIXELPERFECT_ZOOM (off by default) changes the scaling algorithm for zoom to be pixel perfect, losing some granularity in the process. This zoom algorithm does not work nicely with following DFs native zoom, so it is off by default.

Before:
image
After:
image

PIXELPERFECT_ZOOM makes the scale an integer when zooming in to avoid
floating point issues causing gaps.
EXTRUDE_TILES extends each sprite by 1px in each dimension to cover any
gaps caused by floating point issues.
@realSquidCoder
Copy link
Contributor

why not make it do the pixel perfect zoom when the tracking is off?

@realSquidCoder
Copy link
Contributor

i know im not on the main team etc but it looks good to me.

@myk002
Copy link
Member

myk002 commented Jan 25, 2025

i know im not on the main team etc but it looks good to me.

your reviews and opinions are welcome for these PRs

Comment on lines +41 to +42
- `stonesense`: added option ``EXTEND_TILES`` to slightly expand sprite to avoid gaps (on by default)
- `stonesense`: added option ``PIXELPERFECT_ZOOM`` to change the zoom scale to avoid gaps (off by default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these two mutually exclusive? should they be an enum instead of two booleans?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fully certain on that. One has an essentially invisible approach, and the other makes major changes to zoom/scaling. With how the options make changes in seemingly unrelated spots, I wasn't sure if they make sense to combine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fair enough. we will have a chance to re-evaluate our config choices when we move to toml as well.

@myk002 myk002 merged commit 930db8f into DFHack:master Jan 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants