-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(geom): create Rectangled/f from point (and set to point) #16
Conversation
} | ||
|
||
/** | ||
* Set this rectangle to be a clone of <code>source</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Set this rectangle to be a clone of <code>source</code>. | |
* Set this rectangle to be a clone of <code>point</code>. |
@@ -170,6 +192,31 @@ public Rectangled set(Rectangled source){ | |||
return this; | |||
} | |||
|
|||
/** | |||
* Set this rectangle to be a clone of <code>source</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this comment needs updating
/** | ||
* Set this rectangle to be a clone of <code>source</code>. | ||
* | ||
* @param point the coordinate of both minimum and maximum corner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in line with the other two. Or rather they with this respectively.
this.minX = source.minX; | ||
this.minY = source.minY; | ||
this.maxX = source.maxX; | ||
this.maxY = source.maxY; | ||
return this; | ||
} | ||
|
||
/** | ||
* Set this rectangle to be a clone of <code>source</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment needs updating.
} | ||
|
||
/** | ||
* Set this rectangle to be a clone of <code>source</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Set this rectangle to be a clone of <code>source</code>. | |
* Set this rectangle to be a clone of <code>point</code>. |
@@ -380,11 +407,9 @@ public boolean isValid() { | |||
/** | |||
* Compute the rectangle of intersection between <code>this</code> and the given rectangle. | |||
* <p> | |||
* If the two rectangles do not intersect, then {@link Float#NaN} is stored in each component | |||
* of <code>dest</code>. | |||
* If the two rectangles do not intersect, then {@link Float#NaN} is stored in each component of <code>dest</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no dest
is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto-formatting 🙄 I will not go over the unrelated docstrings in this PR.
@@ -394,11 +419,9 @@ public Rectanglef intersection(Rectanglef other) { | |||
/** | |||
* Compute the rectangle of intersection between <code>this</code> and the given rectangle. | |||
* <p> | |||
* If the two rectangles do not intersect, then {@link Float#NaN} is stored in each component | |||
* of <code>dest</code>. | |||
* If the two rectangles do not intersect, then {@link Float#NaN} is stored in each component of <code>dest</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no dest
is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here (unrelated formatting change).
Required by Terasology/PolyWorld#35 (tests).