Add minimum zoom button, reorganize zoom options#13
Add minimum zoom button, reorganize zoom options#13t-wy merged 3 commits intot-wy:custom-improvefrom
Conversation
|
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 |
…ments Add minimum zoom button, reorganize zoom options
…ents Add minimum zoom button, reorganize zoom options
Add minimum zoom button, reorganize zoom options
|
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 😅 |
Add minimum zoom button, reorganize zoom options
Add minimum zoom button, reorganize zoom options
Add minimum zoom button, reorganize zoom options
Add minimum zoom button, reorganize zoom options
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.