Community
Participate
Working Groups
GC has setClipping(something), which overwrites the clipping. We would like API to intersect "something" with the existing "something". For example: gc.setClipping(dirtyRect); ... gc.clip(myObject.getRectangularBounds()); myObject.goPaintOn(gc); .. The effects of gc.clip(..) would be the same as gc.setClipping(r1.intersect(r2)); Of course we can do this ourselves if it's just a bunch of rectangles. But once you mix in paths and regions, it's impossible to do.
Region already has an intersect() method for both Regions and Rectangles. The only thing which is not supported is Path.
Yes, region has intersect, but what is the current region in the current transformation? It's not available. If I set a region, then rotate the GC, I cannot get back the rotated region.
Is somebody looking at that? I developed a library to render PDFs using Java2D. Right now, I'm converting it into a pure SWT implementation. Unfortunately, there is no equivalent for the java.awt.Graphics API "clip(Shape s) Intersects the current Clip with the interior of the specified Shape and sets the Clip to the resulting intersection." in SWT. For now, I save the last clipping path, convert it to a Java2D shape, do the intersecting and then convert the resulting Shape back into a Path ... I think we need the clipping functionalty mentioned in this bug report and also a way to intersect arbitrary Paths.
Yes, we are also wondering how to intersect two Path, or Path with Region.
+1. We have a PDF rendering library too.
Another vote on this one ... Mixing paths and non-paths in the clipping system is currently impossible without writing platform-specific SWT code (bleagh). I don't know about other OS's, but on OS X, clipping is actually intersecting by default, so the current code in SWT works AROUND this feature by calling setClipping(0) prior to clipping to the specified Path. I second the gc.clip(...) API suggestion.
*** Bug 312242 has been marked as a duplicate of this bug. ***
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. If you have further information on the current state of the bug, please add it. 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.