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 218173 Details for
Bug 384059
[GEF4] Point.getCentroid(Point...) returns wrong centroid
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]
Fixes the getCentroid() bug
point.getCentroid.patch (text/plain), 828 bytes, created by
Matthias Wienand
on 2012-07-02 11:57:31 EDT
(
hide
)
Description:
Fixes the getCentroid() bug
Filename:
MIME Type:
Creator:
Matthias Wienand
Created:
2012-07-02 11:57:31 EDT
Size:
828 bytes
patch
obsolete
>--- a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Point.java >+++ b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Point.java >@@ -92,11 +92,11 @@ public class Point implements Cloneable, Serializable { > } > > // closing segment >- a = points[points.length - 2].x * points[points.length - 1].y >- - points[points.length - 2].y * points[points.length - 1].x; >+ a = points[points.length - 1].x * points[0].y >+ - points[points.length - 1].y * points[0].x; > sa += a; >- cx += (points[points.length - 2].x + points[points.length - 1].x) * a; >- cy += (points[points.length - 2].x + points[points.length - 1].x) * a; >+ cx += (points[points.length - 1].x + points[0].x) * a; >+ cy += (points[points.length - 1].y + points[0].y) * a; > > return new Point(cx / (3 * sa), cy / (3 * sa)); > }
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 384059
:
218173