Skip to content

Conversation

@almarklein
Copy link
Member

@almarklein almarklein commented Nov 13, 2025

This fixes two problems that seem to occur:

  • The canvas was initialized with size (0, 0).
  • For some backends, setting the logical size has no immediate effect (most notably the jupyter backend).

This PR:

  • Initializes the size (before it knows the backend's actual size) to (1, 1).
  • When the logical size is set, it is applied immediately, and possibly adjusted when the backend updates its new physical size. In the time between that, the total_pixel_ratio is adjusted, effectively creating a temporary zoom effect. In most cases you'll never observe this, because the new physical size likely resolves before the next draw.
  • Refactors the size-info dict to be more stand-alone.
  • Tests.
  • Adjust docs.

@almarklein almarklein marked this pull request as ready for review November 13, 2025 12:29
@almarklein almarklein merged commit 7dc909b into main Nov 13, 2025
13 checks passed
@almarklein almarklein deleted the sizeinfo branch November 13, 2025 14:06
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