Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 537725 - [HiDPI] GC 'lineWidth' is initialized to '0' causes problem at HiDPI
Summary: [HiDPI] GC 'lineWidth' is initialized to '0' causes problem at HiDPI
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.9   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-06 09:35 EDT by Niraj Modi CLA
Modified: 2020-08-16 15:55 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niraj Modi CLA 2018-08-06 09:35:32 EDT
Issue originally reported at https://bugs.eclipse.org/bugs/show_bug.cgi?id=537273#c15

This is HiDPI scenario running snippet in attachment 275116 [details], just compare the rectangles outside the checkbox in this snippet. To get the painting right, you would need a double-sized rectangle line width, too.
Comment 1 Niraj Modi CLA 2018-08-06 09:41:30 EDT
Tested this issue, root cause:
This GC behavior is by design as the 'lineWidth' is always initialized to '0', which internally means the fastest line drawing algorithm(which in real drawing corresponds to '1'px width).

So, when we move to HiDPI say 200% this 'lineWidth' continues to be remain same and doesn't scale up.
Comment 2 Niraj Modi CLA 2018-08-06 09:50:34 EDT
Since default 'lineWidth' zero doesn't cater to HiDPI scenarios, we should consider changing the initial value of GCData#lineWidth from '0' to '1'
I will be testing this and will share a gerrit patch.
Comment 3 Thomas Singer CLA 2018-08-06 11:19:20 EDT
When drawing something with 200% zoom, it should produce the same result as when drawing it with 100% zoom and then scaling it up to 200% zoom (except of finer antialiasing painting results when painting directly to 200% zoom). I think, if this is not supported by the operating system, then it could become a quite challenging if not impossible task. If it is not possible, we'd rather should stick with the best drawing support, even if this means that the drawing code needs to handle the zooming itself (like we do with SmartGit on Windows, where we always draw at 100%).
Comment 4 Eclipse Genie CLA 2020-08-16 15:55:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.