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
[Theming] ColorWheel color chooser is not honoring high DPI scale factor #457
Comments
The fix can be made inside the ColorWheel class. Changes are needed in two locations. In MouseHandler.update(MouseEvent e) you can do something like this:
in paintComponent(), a similar fix is needed. (Cut paste is not working for me right now for some reason unrelated to Radiance!) |
Ok. In paintComponent(), do something like this:
|
PS: I personally think it looks better to enlarge that cursor a little bit. Something like this:
|
What are the changes in paintComponent() for? |
Ah, it's for the indicator box |
Ok, the cursor looks exactly the same size in those two uploaded images, but when the two images are displayed on the two monitors they are shown at the same physical size, which means the cursor in the top picture looks small and the one in the lower picture looks big. |
Oh, the size should be scaled in the 1x rendering. I'll make a quick fix in 7.0.1 |
Thanks. Maybe wait a few days in case other bugs come in? I'll try to test 7.0.0 (if there are no breaking changes that actually affect me.) |
I'll cut 7.0.1 later in the day |
PS: In my quick tests, I didn't notice any problems upgrading from 6.5 to 7.0. |
I cannot explain why it works for you and not me! I'm Java 11 on Windows 10, two displays, one 2.5 scale (#1 in image) and one 1.0 scale (#2 in image), using "extend these displays". I mis-spoke earlier. It is the low-dpi display that shows the problem, with scale factor 1.0, while my main screen is scale factor 2.5. |
I don't have a 1x monitor, only 2x and 2.5x. I think that it's due to the mismatch between the creation of the crayons image in |
I'm thinking that the logic in |
I can try testing code changes. |
"Or maybe multiply instead of divide." Neither of those works correctly. I'll try some other things.... |
This is what works for me:
|
PS: It would be really nice if there were a setting somewhere to disable drawing the color name in this panel. That way I wouldn't need to worry about translation. Just have some flag to disable the call to "g2d.drawString(selectedCrayon.name....)" |
An API to configure the color chooser would be a nice addition, something along the lines of an enum that lists all available panels, and allows the app to choose which ones to display and in which order. I'll need to think of a way to configure the specific per-panel display options so that it's not just for the color name of the selected crayon, but something a bit more generic. That would happen in the next release. |
Thanks for fixing the crayons and color wheel! "lists all available panels, and allows the app to choose which ones to display and in which order" Something like that already exists, though without the enum. Please don't take this ability away!
I only keep the ones that scale well and don't have much (or any) text to translate. I was also able to easily test changes, like those scaling options above, by creating a custom chooser and including it in the list:
|
FWIW, for testing purposes one may use |
I think that would apply to all connected monitors. The environment that was needed to recreate this bug was to have one high-res monitor, and another at 1x. |
Ah, all right. I've missed the secondary issue of the color cursor not adjusting its size on a secondary monitor with a different DPI. |
Using -Dsun.java2d.uiScale=1.0 would cause all parts of the program to run without scaling to match the monitor resolution. Thus on a 2.5-scale monitor, text in normal font sizes would be too small to read. But thanks for the comment. And your xbrz library could prove useful. :) |
Version of Radiance 6.5.0
Sub-project Theming
Version of Java 11
Version of OS Windows 10
The issue you're experiencing
When using the ColorWheelChooser, the image of the color wheel is being properly scaled for high DPI monitors, but the calculation of mouse position corresponding to each color is not being scaled. This means that you can choose a location outside of the wheel. In fact you must do so if you want to choose the most saturated version of the color.
The text was updated successfully, but these errors were encountered: