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 181112 Details for
Bug 327962
ScaledGraphics zoomLineWidth implementation is incorrect and leads to image anomalies
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
Bug_327962 (text/plain), 4.19 KB, created by
Alex Boyko
on 2010-10-18 12:47:20 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Alex Boyko
Created:
2010-10-18 12:47:20 EDT
Size:
4.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.draw2d >Index: src/org/eclipse/draw2d/ScaledGraphics.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/ScaledGraphics.java,v >retrieving revision 1.44 >diff -u -r1.44 ScaledGraphics.java >--- src/org/eclipse/draw2d/ScaledGraphics.java 19 May 2010 20:10:26 -0000 1.44 >+++ src/org/eclipse/draw2d/ScaledGraphics.java 18 Oct 2010 16:46:17 -0000 >@@ -302,11 +302,11 @@ > /** @see Graphics#drawImage(Image, int, int) */ > public void drawImage(Image srcImage, int x, int y) { > org.eclipse.swt.graphics.Rectangle size = srcImage.getBounds(); >- graphics.drawImage(srcImage, 0, 0, size.width, size.height, >- (int) (Math.floor((x * zoom + fractionalX))), >- (int) (Math.floor((y * zoom + fractionalY))), >- (int) (Math.floor((size.width * zoom + fractionalX))), >- (int) (Math.floor((size.height * zoom + fractionalY)))); >+ graphics.drawImage(srcImage, 0, 0, size.width, size.height, (int) (Math >+ .floor((x * zoom + fractionalX))), (int) (Math >+ .floor((y * zoom + fractionalY))), (int) (Math >+ .floor((size.width * zoom + fractionalX))), (int) (Math >+ .floor((size.height * zoom + fractionalY)))); > } > > /** @see Graphics#drawImage(Image, int, int, int, int, int, int, int, int) */ >@@ -323,9 +323,9 @@ > /** @see Graphics#drawLine(int, int, int, int) */ > public void drawLine(int x1, int y1, int x2, int y2) { > graphics.drawLine((int) (Math.floor((x1 * zoom + fractionalX))), >- (int) (Math.floor((y1 * zoom + fractionalY))), >- (int) (Math.floor((x2 * zoom + fractionalX))), >- (int) (Math.floor((y2 * zoom + fractionalY)))); >+ (int) (Math.floor((y1 * zoom + fractionalY))), (int) (Math >+ .floor((x2 * zoom + fractionalX))), (int) (Math >+ .floor((y2 * zoom + fractionalY)))); > } > > /** @see Graphics#drawOval(int, int, int, int) */ >@@ -345,8 +345,8 @@ > > /** @see Graphics#drawPoint(int, int) */ > public void drawPoint(int x, int y) { >- graphics.drawPoint((int) Math.floor(x * zoom + fractionalX), >- (int) Math.floor(y * zoom + fractionalY)); >+ graphics.drawPoint((int) Math.floor(x * zoom + fractionalX), (int) Math >+ .floor(y * zoom + fractionalY)); > } > > /** >@@ -416,10 +416,10 @@ > return; > } > try { >- graphics.drawTextLayout(scaled, >- (int) Math.floor(x * zoom + fractionalX), >- (int) Math.floor(y * zoom + fractionalY), selectionStart, >- selectionEnd, selectionBackground, selectionForeground); >+ graphics.drawTextLayout(scaled, (int) Math.floor(x * zoom >+ + fractionalX), (int) Math.floor(y * zoom + fractionalY), >+ selectionStart, selectionEnd, selectionBackground, >+ selectionForeground); > } finally { > scaled.dispose(); > } >@@ -867,7 +867,8 @@ > double dyFloat = dy * zoom + fractionalY; > fractionalX = dxFloat - Math.floor(dxFloat); > fractionalY = dyFloat - Math.floor(dyFloat); >- graphics.translate((int) Math.floor(dxFloat), (int) Math.floor(dyFloat)); >+ graphics >+ .translate((int) Math.floor(dxFloat), (int) Math.floor(dyFloat)); > } > > /** @see Graphics#translate(float, float) */ >@@ -876,16 +877,19 @@ > double dyFloat = dy * zoom + fractionalY; > fractionalX = dxFloat - Math.floor(dxFloat); > fractionalY = dyFloat - Math.floor(dyFloat); >- graphics.translate((int) Math.floor(dxFloat), (int) Math.floor(dyFloat)); >+ graphics >+ .translate((int) Math.floor(dxFloat), (int) Math.floor(dyFloat)); > } > > private Rectangle zoomClipRect(Rectangle r) { > tempRECT.x = (int) (Math.floor(r.x * zoom + fractionalX)); > tempRECT.y = (int) (Math.floor(r.y * zoom + fractionalY)); > tempRECT.width = (int) (Math >- .ceil(((r.x + r.width) * zoom + fractionalX))) - tempRECT.x; >+ .ceil(((r.x + r.width) * zoom + fractionalX))) >+ - tempRECT.x; > tempRECT.height = (int) (Math >- .ceil(((r.y + r.height) * zoom + fractionalY))) - tempRECT.y; >+ .ceil(((r.y + r.height) * zoom + fractionalY))) >+ - tempRECT.y; > return tempRECT; > } > >@@ -915,7 +919,7 @@ > } > > float zoomLineWidth(float w) { >- return w; >+ return (float) (w * zoom); > } > > private int[] zoomPointList(int[] points) {
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
Actions:
View
|
Diff
Attachments on
bug 327962
:
181060
|
181061
|
181062
|
181063
| 181112