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 85012 Details for
Bug 212280
org.eclipse.draw2d.RelativeBendpoint#getLocation() returns a point with a slight error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
GEF_RelativeBendpoint_Dec07 (text/plain), 1.86 KB, created by
Alex Boyko
on 2007-12-11 17:50:23 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Alex Boyko
Created:
2007-12-11 17:50:23 EST
Size:
1.86 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.draw2d >Index: src/org/eclipse/draw2d/RelativeBendpoint.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/RelativeBendpoint.java,v >retrieving revision 1.8 >diff -u -r1.8 RelativeBendpoint.java >--- src/org/eclipse/draw2d/RelativeBendpoint.java 30 Mar 2005 21:27:45 -0000 1.8 >+++ src/org/eclipse/draw2d/RelativeBendpoint.java 7 Dec 2007 16:31:19 -0000 >@@ -12,6 +12,7 @@ > > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.draw2d.geometry.Point; >+import org.eclipse.draw2d.geometry.PrecisionPoint; > > /** > * RelativeBendpoint is a Bendpoint that calculates its location based on its distance >@@ -58,19 +59,15 @@ > * @since 2.0 > */ > public Point getLocation() { >- Point a1 = getConnection().getSourceAnchor().getReferencePoint(); >- Point a2 = getConnection().getTargetAnchor().getReferencePoint(); >+ PrecisionPoint a1 = new PrecisionPoint(getConnection().getSourceAnchor().getReferencePoint()); >+ PrecisionPoint a2 = new PrecisionPoint(getConnection().getTargetAnchor().getReferencePoint()); > >- Point p = new Point(); >- Dimension dim1 = d1.getCopy(), dim2 = d2.getCopy(); >+ getConnection().translateToRelative(a1); >+ getConnection().translateToRelative(a2); > >- getConnection().translateToAbsolute(dim1); >- getConnection().translateToAbsolute(dim2); >- >- p.x = (int)((a1.x + dim1.width) * (1f - weight) + weight * (a2.x + dim2.width)); >- p.y = (int)((a1.y + dim1.height) * (1f - weight) + weight * (a2.y + dim2.height)); >- getConnection().translateToRelative(p); >- return p; >+ return new PrecisionPoint((a1.preciseX + d1.width) * (1f - weight) >+ + weight * (a2.preciseX + d2.width), (a1.preciseY + d1.height) * (1f - weight) + weight >+ * (a2.preciseY + d2.height)); > } > > /**
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 212280
:
84746
|
85012
|
85584
|
90696