Open MarcelBoerner opened 2 years ago
200% zoom missing from this comparison ?
SWT works best with integer scaling factor, same was documented: https://www.eclipse.org/eclipse/news/4.6/platform.php#swt-autoscale-tweaks
We appreciate ideas and fix-proposal to improve the support here.
For zoom values of 100, 125 & 150 rectangle is the same but text rendered using selected scale. As possible solution which also applied for higher zoom factor:
Point textSize = e.gc.textExtent("Long Test Text");
e.gc.drawString("Long Test Text", 20, 150);
e.gc.drawRectangle(20, 150, textSize.x, textSize.y);
On a pure SWT application we used the SWTs gc with drawText, draw Rectangle and draw String method. When using scalings with different values you see that the text and the drawing of the rectangle are not scaled the same way. So the text is sometimes to small or cuts the rectangle. So SWT is not usable for custom drawings (like drawing a table) since the customers do get texts which are cut off or cells wich have much lost space which is not used.
In the above picture you can see how icons lose information when they are scaled down, which also happens to images (1). The title areas are adapted to their height at each scaling but the width is only extended when you go above or blow the 175% (2). The height and the width of the shell on which is drawen is also only adapted on 175% scaling changes (3). But the biggest problem is that drawing with drawText or drawString and using the draw Rectangle method, leads to text which does not fit into the drawen rectangles at different zooms (4)
The following snippet delivers the results seen on the picture when starting it with different scalings.
`
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
try {
shell.addPaintListener(new PaintListener() {
} `