| Summary: | GC: The background Pattern is not always transformed. | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Matthias Wienand <matthias.wienand> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | arunkumar.thondapu, gheorghe, Silenio_Quarti, xixiyan |
| Version: | 4.2.1 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux-GTK | ||
| Whiteboard: | stalebug | ||
| Attachments: | |||
Created attachment 226119 [details]
Snippet demonstrating the incorrect behavior.
Created attachment 226120 [details]
Screenshot demonstrating correct behavior.
Created attachment 226121 [details]
Screenshot demonstrating incorrect behavior.
I can reproduce the issue on SWT master as of today, with GTK3.22, Fedora 28. 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. |
Created attachment 226118 [details] Snippet demonstrating the correct behavior. The SWT GC allows the user to set a background Pattern that can be used to fill arbitrary shapes with a color gradient or an image. I would expect that Pattern to anchor at the transformed origin in order to be able to fill the shapes with the portion of the Pattern that I want to fill them with. Unfortunately, the background Pattern does only anchor at the transformed origin for the first fill() operation after setting the background Pattern on the GC. Subsequent fill() operations use the same anchor for the Pattern. It may be specific to my system (SWT uses Cairo) as I assume that the bug is inside of the org.eclipse.swt.graphics.GC#checkGC(int) method. Before filling is performed, the GC calls the checkGC(int) method with the argument GC.FILL. Presumably, GC.FILL is a bitmask for the flag that indicates whether the GC is prepared to perform fill() operations or not. After preparing the GC for fill() operations, checkGC(GC.FILL) returns immediately. This can be prevented by explicitly setting the background Pattern to null and then resetting it before calling fill(). To demonstrate the behavior, I created two snippets: - Wrong behavior: SwtPatternWrong.java (output: SwtPatternWrong.png) - Correct behavior: SwtPatternCorrect.java (output: SwtPatternCorrect.png) regards, Matthias