-
Notifications
You must be signed in to change notification settings - Fork 6
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
HiDPI support #156
Comments
My monitor scales to 150% so I've been doing something like this, which I think will fit more scenarios: local ret, val = reaper.ThemeLayout_GetLayout("mcp", -3)
local scaleFactor = val / 256 Then multiply coordinates and dimensions by the scale factor |
AFAIK, if ThemeLayout_GetLayout returns 512, set gfx.ext_retina=1 else leave it as 0. |
Would the drawing logic still have to double everything, or does HiDPI mode do that automatically? |
[edited to provide additional comments]
gfx.ext_retina = 1.0
gfx.init(NAME, w, h, dock, x, y)
if gfx.ext_retina ~= 1.0 then
gfx.quit()
gfx.init(NAME, w*gfx.ext_retina, h*gfx.ext_retina, dock, x, y)
end Dimensions of the window change automatically when moving to a different screen. When I |
Not sure how much further you got on this but I am running on a 2015 macbook pro with a retina screen and my value returned from |
Another problem is that even though the x and y ratios can be modified it seems that text remains incredibly small. I was able to manually remedy this by changing the font size which is passed to gfx at line 26 of the public/fonts. I'm not sure what a good interface for managing this is (or if it should be automatic). My question is - what is a quick fix for me to pas my own 'scale' down to this part of your wonderful graphics library? |
There isn't one, sadly. User input is all handled in one place so that might not be too hard to make scaleable, but every element does its own drawing - all of them would have to be rewritten to be aware of the current scale and account for it. The idea solution would be to add some utilities for translating screen space to/from the canvas' coordinates, then refactor the user input, event handling, and element drawing so that everything is done via those utilities. That said, I've had to put the project on hold so whether I ever get that far is a separate question. |
hmm okay. I think then I will try and make some sort of ad hoc method for changing the font size according to the detected resolution and then scaling my elements by a scalar depending on th same thing. I don't have the architectural chops for lua but I have a fair bit of experience with reascript so I'd be happy to contribute if you need some jobs delegated. one quick question - is reaper.ThemeLayout your own appendage to their table or functions? I couldn't find it in the API and I'd like to investigate how to use it further. |
No, Scythe doesn't add anything to the existing namespaces ( API: retval, name = reaper.ThemeLayout_GetLayout( section, idx ) |
Ah okay, it is documented in x-raym but not the official docs. Is it possible to use the |
It is in the official docs - in Reaper's Help menu, choose Reascript Documentation to have it generate docs for your current version. The theme stuff showed with with 6.0, I believe. You can use Font.addFonts to override the base fonts. All of the presets are stored in I should note, though, that font sizes don't scale linearly - 24pt will not necessarily be twice the size of 12pt. The most accurate solution would be to measure the pixel size of, say, |
The Get/Set Themelayout-functions were added somewhere in the 5.x-versions, probably to let users help testing the alpha-versions of the v6-default-theme. |
local ret, val = reaper.ThemeLayout_GetLayout("mcp", -3)
-> 256 for regular, 512 for Retinagfx
calls and doubling their coordinates/dimensionsThe text was updated successfully, but these errors were encountered: