-
Notifications
You must be signed in to change notification settings - Fork 21
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
Low resolution on images and canvas #72
Comments
RAP/RWT does not scale the images at all. If some scaling occurs, that's probably comes from the JFace/Workbench code. There is an old enhancement request here: Are you using e3 or e4? |
Is it possible to demonstrate the issue with a simple standalone RWT snippet (entry point), without jface/workbench? Probably you can create a patch against our Controls demo or test it there. |
Ivan, thanks a lot for the quick reply. We're not using any JFace nor Workbench, only pure SWT and we're on 3.22 for RAP. If we could get the Canvas to not be blurry that would be a fantastic first step. We're doing our own rendering in a bit of JavaScript on top of Canvas. We set data on it so it knows what to draw. If there's a way for us to change the devicePixelRatio in some way at the start of the application? That would be more than enough. A quick browser tab refresh would be all that's needed to pick up a ratio in that case. |
Since Apache Hop is open source, you can try the application yourself with:
Then open your browser on http://localhost:8080 |
Another example of low resolution in my browser (on 4k screen): https://rap.eclipsesource.com/demo/release/controls/#Canvas |
Is this what you need? https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-webkit-device-pixel-ratio |
... and maybe this will help too: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio |
Thanks a lot @ifurnadjiev. There are 2 aspects to this really.
The main concern then is to "disable" this toolbar icon. I'm looking at some JavaScript for that. The second part is the resolution of the canvas areas. I know about the device/pixel ratio. What I don't know is how to set it or change it in the RAP CSS file that we have, for example. Any help with both topics would be really nice. It would for example be really nice if we had a way to set the SVG images for enabled/disabled on the ToolbarItem itself:
The image and disabled image would then be the fallback scenario we already have. Any tips on how to implement this would be welcome. I'd be happy to create the PR. |
To use "standard" (not RWT styling) CSS in your application you have two options:
|
In order to set enabled/disabled SVG image on ToolItem you can try to execute a JavaScript with
|
Unfortunately it looks like there's already style, header, meta information being set in rwt-index.html. I'll see if I can play around with this. I have a hard time building the project if I dare to change anything ;-) |
So I managed to get the resolution increased, somewhat. Unfortunately this leads to all sorts of side-effects like the cursor hitting some things like buttons but missing mouse operations in general by a factor devicePixelRatio. |
We used scale to draw the canvas in double the size and resized with css, that worked quite good, see #232 . |
In the Apache Hop project we're using Eclipse SWT to render our Hop GUI application. It's essentially a data integration IDE.
We also have a version of that runs on RAP which looks something like this:
It runs off the same user interface source code with minimal exceptions which is pretty cool all by itself.
The main concern in general is that images in toolbars, menu-items and so on have a low resolution which is about half of what we'd expect. We expect that there's a general setting at play since the resolution set on the canvas is also half of what we'd expect.
The question for this issue then is: where in the code is it decided to half the resolution of the whole user interface and how can we change this behavior? We'd be happy to test and create a PR if needed.
Thanks in advance for any tips!
The text was updated successfully, but these errors were encountered: