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 260834 Details for
Bug 491404
Enhancement for Line (getMidPoint)
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 to add getMidPoint method to Line
line-getmidpoint.patch (text/plain), 750 bytes, created by
Colin Sharples
on 2016-04-10 20:42:48 EDT
(
hide
)
Description:
Patch to add getMidPoint method to Line
Filename:
MIME Type:
Creator:
Colin Sharples
Created:
2016-04-10 20:42:48 EDT
Size:
750 bytes
patch
obsolete
>diff --git a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >index 08814cc..0dd8594 100644 >--- a/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >+++ b/org.eclipse.gef4.geometry/src/org/eclipse/gef4/geometry/planar/Line.java >@@ -321,6 +321,17 @@ > return getP1().getDistance(getP2()); > } > >+ /** >+ * Returns the {@link Point} representing the mid-point of this {@link Line} >+ * >+ * @return the mid-point of this {@link Line} >+ */ >+ public Point getMidPoint() { >+ Point p1 = getP1(); >+ Point p2 = getP2(); >+ return new Point((p1.x + p2.x) / 2, (p1.y + p2.y) / 2); >+ } >+ > // TODO: add specialized getOverlap() > > /**
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 491404
:
260834
|
260872
|
260940