Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 174243 Details for
Bug 319796
SWTGraphics#clipPath(Path) need to ensure the path is closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
SWT_Graphics_ClipPath (text/plain), 3.71 KB, created by
Alex Boyko
on 2010-07-13 20:26:12 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Alex Boyko
Created:
2010-07-13 20:26:12 EDT
Size:
3.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.draw2d >Index: src/org/eclipse/draw2d/SWTGraphics.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTGraphics.java,v >retrieving revision 1.57 >diff -u -r1.57 SWTGraphics.java >--- src/org/eclipse/draw2d/SWTGraphics.java 19 May 2010 20:10:27 -0000 1.57 >+++ src/org/eclipse/draw2d/SWTGraphics.java 14 Jul 2010 00:22:49 -0000 >@@ -145,9 +145,9 @@ > public void setOn(GC gc, int translateX, int translateY) { > int xInt = (int) Math.floor(left); > int yInt = (int) Math.floor(top); >- gc.setClipping(xInt + translateX, yInt + translateY, >- (int) Math.ceil(right) - xInt, (int) Math.ceil(bottom) >- - yInt); >+ gc.setClipping(xInt + translateX, yInt + translateY, (int) Math >+ .ceil(right) >+ - xInt, (int) Math.ceil(bottom) - yInt); > } > > public void translate(float dx, float dy) { >@@ -226,7 +226,7 @@ > > AA_MASK = 3 << AA_SHIFT; > FILL_RULE_MASK = 1 << FILL_RULE_SHIFT; // If changed to more than 1-bit, >- // check references! >+ // check references! > INTERPOLATION_MASK = 3 << INTERPOLATION_SHIFT; > TEXT_AA_MASK = 3 << TEXT_AA_SHIFT; > XOR_MASK = 1 << XOR_SHIFT; >@@ -364,8 +364,8 @@ > } > > checkSharedClipping(); >- currentState.relativeClip.intersect(rect.x, rect.y, rect.right(), >- rect.bottom()); >+ currentState.relativeClip.intersect(rect.x, rect.y, rect.right(), rect >+ .bottom()); > appliedState.relativeClip = null; > } > >@@ -558,7 +558,9 @@ > */ > public void fillGradient(int x, int y, int w, int h, boolean vertical) { > checkPaint(); >- gc.fillGradientRectangle(x + translateX, y + translateY, w, h, vertical); >+ gc >+ .fillGradientRectangle(x + translateX, y + translateY, w, h, >+ vertical); > } > > /** >@@ -871,8 +873,9 @@ > changes &= ~XOR_MASK; > if (changes != 0) { > if ((changes & INTERPOLATION_MASK) != 0) { >- gc.setInterpolation(((hints & INTERPOLATION_MASK) >> INTERPOLATION_SHIFT) >- - INTERPOLATION_WHOLE_NUMBER); >+ gc >+ .setInterpolation(((hints & INTERPOLATION_MASK) >> INTERPOLATION_SHIFT) >+ - INTERPOLATION_WHOLE_NUMBER); > } > > if ((changes & FILL_RULE_MASK) != 0) { >@@ -1085,8 +1088,9 @@ > initTransform(false); > if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) { > // If there is a pending change to the fill rule, apply it first. >- gc.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT) >- - FILL_RULE_WHOLE_NUMBER); >+ gc >+ .setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT) >+ - FILL_RULE_WHOLE_NUMBER); > // As long as the FILL_RULE is stored in a single bit, just toggling > // it works. > appliedState.graphicHints ^= FILL_RULE_MASK; >@@ -1107,8 +1111,9 @@ > initTransform(false); > if (((appliedState.graphicHints ^ currentState.graphicHints) & FILL_RULE_MASK) != 0) { > // If there is a pending change to the fill rule, apply it first. >- gc.setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT) >- - FILL_RULE_WHOLE_NUMBER); >+ gc >+ .setFillRule(((currentState.graphicHints & FILL_RULE_MASK) >> FILL_RULE_SHIFT) >+ - FILL_RULE_WHOLE_NUMBER); > // As long as the FILL_RULE is stored in a single bit, just toggling > // it works. > appliedState.graphicHints ^= FILL_RULE_MASK; >@@ -1476,5 +1481,13 @@ > } > } > } >+ if (start != end) { >+ int n = 0; >+ int[] temp = new int[end - start]; >+ for (int k = start; k < end; k++) { >+ temp[n++] = Math.round(points[k]); >+ } >+ region.add(temp); >+ } > } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
aboyko
:
review?
Actions:
View
|
Diff
Attachments on
bug 319796
:
174242
| 174243