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

More typical zooming effect #37

Closed
wants to merge 3 commits into from
Closed

More typical zooming effect #37

wants to merge 3 commits into from

Conversation

fdcote
Copy link
Contributor

@fdcote fdcote commented Feb 8, 2025

This pull request implements a more typical zooming effect, addressing #36.

The implementation additionally fixes a crash that occurs when resizing the terminal window to a height of one cell.

@Eloitor
Copy link
Contributor

Eloitor commented Feb 9, 2025

works very well :)

@freref
Copy link
Owner

freref commented Feb 9, 2025

I implemented it like this at first, but the impact on performance is too big, any ideas?

@fdcote
Copy link
Contributor Author

fdcote commented Feb 9, 2025

I think the impact on performance comes down to the number of pixels (resolution × size of page), so the impact is more pronounced when both the contents and the page are scaled even beyond the window’s boundaries without restricting the view. However, restricting the view, as in the proposed implementation, limits the impact.

On my end, the proposed zooming implementation seems on par performance-wise with the current approach for the same window size.

@AaronVerDow
Copy link
Contributor

AaronVerDow commented Feb 9, 2025

I loaded a beats per minute tool that graphs to test the difference. I loaded this page on my phone and tapped in sync with zoom in. Before this PR I got a relatively flat 75 bpm, after this PR I started at 60 bpm and slowly dropped into the low 50s. There is a drop in performance but the default zoom performance isn't amazing to begin with.

EDIT: I completely forgot that I was testing this over ssh. On my local system I also think the difference is negligible.

Personally the better view is more important to me than the performance difference of getting there. If this is what the final product should look like I think we should keep that behavior and look for optimizations rather than change the final product for a workaround.

@AaronVerDow
Copy link
Contributor

For the minimum zoom: I was initially against zooming out beyond the initial size but I am happy with the min zoom config option.

@fdcote
Copy link
Contributor Author

fdcote commented Feb 10, 2025

Just to add more details to this discussion:

My initial strategy (not submitted here) was to scale the entire page with a rendered area (bbox) that might go beyond the window’s view and let the window clip the view if needed. This strategy does indeed greatly affect zooming performance, and I wonder if that might be what @freref is referring to.

However, what is submitted here adopts a different strategy: bbox is adjusted so that it never exceeds the size of the window. As a result, the zooming performance feels about the same as it is now when the size parameter is set to 1. So, maybe this is a non issue...?

@freref
Copy link
Owner

freref commented Feb 21, 2025

Closing in favor of #47 which continues this work

@freref freref closed this Feb 21, 2025
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.

4 participants