Skip to content

Comments

Add minimum zoom button, reorganize zoom options#13

Merged
t-wy merged 3 commits intot-wy:custom-improvefrom
Commenter25:integer-increments
Jan 17, 2026
Merged

Add minimum zoom button, reorganize zoom options#13
t-wy merged 3 commits intot-wy:custom-improvefrom
Commenter25:integer-increments

Conversation

@Commenter25
Copy link

Following up on what I proposed in #8, this PR adds a button which zooms out as far as possible before wplace will no longer render art. Rather than showing the actual zoom value for this (which is lengthy and irrelevant), it simply shows "Min" for minimum zoom.

I also added a 4x zoom option, simply because I feel the extra granularity at further distances is nice. To make room for these two new buttons, I have removed the 50x and 100x options, as they zoom in extremely close to the point even small art is hard to fit on screen, and at this point pixel widths become large enough to not appear so unstable.

I refactored the code a fair bit, primarily to make the minimum zoom button cleanly. I have broken this into separate commits for ease of reviewing. If you use the "hide whitespace changes" option, the diffs provided by GitHub become much clearer. I am willing to undo any of this if it does not align with the preferred standard for the project.

@t-wy
Copy link
Owner

t-wy commented Jan 17, 2026

The 50x and 100x buttons were just some tests for me to easily count the number of pixels on screen actually. Feel free to remove so.

For the min (0.38890873) thing, I suppose there are two different values as stated in #8 (comment) and seems like that innerWidth is only checked when the layer loads. Maybe a maptiler value reading can be used instead of a hardcoded value.

For the label statement, maybe it would be clearer to separate the whole part to a new function like createZoomButtons that immediately returns if the container is not found.

@t-wy t-wy merged commit e73e211 into t-wy:custom-improve Jan 17, 2026
github-actions bot added a commit that referenced this pull request Jan 17, 2026
…ments

Add minimum zoom button, reorganize zoom options
github-actions bot added a commit that referenced this pull request Jan 17, 2026
…ents

Add minimum zoom button, reorganize zoom options
github-actions bot added a commit that referenced this pull request Jan 17, 2026
Add minimum zoom button, reorganize zoom options
t-wy added a commit that referenced this pull request Jan 17, 2026
github-actions bot added a commit that referenced this pull request Jan 17, 2026
github-actions bot added a commit that referenced this pull request Jan 17, 2026
@Commenter25
Copy link
Author

Apologies, I was completely unavailable to check this and address your concerns. I do hope it wasn't too much of a hassle to fix this up!

With the hardcoded minimum value, I honestly just forgot you mentioned there were two different values... I had been using that value personally for a while, and figured I should contribute it. If I remembered, I would've tried to figure something else out, though I can't say I would've known how... Your solution is absolutely much better.

As for the label statements, I had thought about making a proper helper function, but I didn't want to be too extreme with changing the coding style. I was worried even converting to guard clauses might be too far 😅

@Commenter25 Commenter25 deleted the integer-increments branch January 18, 2026 06:17
korobkakonfet pushed a commit to korobkakonfet/rusmarble that referenced this pull request Feb 23, 2026
Add minimum zoom button, reorganize zoom options
korobkakonfet pushed a commit to korobkakonfet/rusmarble that referenced this pull request Feb 23, 2026
Add minimum zoom button, reorganize zoom options
korobkakonfet pushed a commit to korobkakonfet/rusmarble that referenced this pull request Feb 23, 2026
Add minimum zoom button, reorganize zoom options
korobkakonfet pushed a commit to korobkakonfet/rusmarble that referenced this pull request Feb 23, 2026
Add minimum zoom button, reorganize zoom options
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

Successfully merging this pull request may close these issues.

2 participants