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 some documentation about scalefactor, px_per_unit #1

Open
wants to merge 18 commits into
base: jw/gl_linux_hidpi
Choose a base branch
from

Conversation

asinghvi17
Copy link

Adds some docs so that it's clear what each thing does.

(Note: I'm not 100% sure that what I wrote was correct, would appreciate if you could check that @jmert)

jmert and others added 18 commits January 17, 2023 17:43
By separating the two concepts, we can create rasterized graphics at
higher resolution than what is shown on screen.

The window scale factor is used to scale the sizes of elements within
the window (and on Linux and Windows, the window size itself from the
requested logical sizes), and the px-per-unit scale factor dictates
the size of the rasterized render.
This works around a crash that otherwise occurs when creating a
screen directly with something like
```julia
screen = GLMakie.Screen(resolution = (100, 100), visible = false)
```

I'm not sure why this is necessary, though, so that probably points
at some subtle logic error in handling scaling factors and/or dimensions
of windows and buffers.
so force the scale and px-per-unit factors to unity for the test.
This was causing problems with setting up the stream size for video
outputs. Instead, just grab the scene size where necessary explicitly.
After identifying failing tests, closer reading suggests the line
rendering shaders all work in normalized units that arise naturally
from comparing the framebuffer size to resolution factor. This means
adding additional scaling is unnecessary since the framebuffer size
is already scaled.
- More explicit `range` to support older versions of Julia
- Force a render of the figure before testing picking operations, since
  that doesn't happen implicitly when the sequence is not done
  with a visible plot interactively.
- Use a less exact test for running within an Xvfb instance to support
  older versions of `xrdb` without the -get option.
@jmert
Copy link
Owner

jmert commented Jan 30, 2023

Thanks, @asinghvi17. I've cherry-picked your commit and expanded the docs a bit more in MakieOrg#2544

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.

3 participants