| Summary: | SWTGraphics#scale is broken when used with Printer on Eclipse 3.7 / GTK | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Peter Severin <peter> | ||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | carolynmacleod4, cedric.brun, nyssen, pwebster | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | 4.2 M4 | ||||||
| Hardware: | All | ||||||
| OS: | Linux-GTK | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 150870 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Peter Severin
Added dependency to #150870. How can SWTGraphics be affected by changes to Printer? I suppose you mean ScaledGraphics? Alexander, I am using SWTGraphics with Printer for native scaling which gets better results. I use code that looks something like this: printer.startPage(); GC gc = new GC(printer); Graphics graphics = new SWTGraphics(gc); Actually I have a PrinterGraphics subclass, similar to one based on ScaledGraphics, that does some device resource handling. But the bug is not specific to scaling as it can be triggered by anything that sets a new Transform on GC: a non-integer translation or a rotation. So it should be also present in PrinterGraphics found in Draw2d. Hi, Peter. Would you be able to provide an SWT-only test case? It would save us some time looking at the problem and testing what we think might be a possible fix. Thanks! Created attachment 206526 [details]
SWT-only test case
I adapted on of the SWT snippets to show the bug. Normally this code should print two identical lines one below the other. However on Eclipse 3.7 the second line will be much bigger, depending on the Printer DPI / 72.0f ratio.
Thank-you, Peter! Reassigning to SWT. Fixed in master: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a Great, Carolyn! Will it be backported to 3.7/3.8 versions? I don't need it but just want to know from which version I can disable my workaround. Backported to 3.7: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_7_maintenance&id=da1f7fdabbd2b4b4a76e6e27218cef07f95be1ce It is already in 3.8 because (most of) the SWT source for 3.8 and 4.2 are the same. |