Skip to content
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

Merged
merged 3 commits into from
Jan 26, 2021

Conversation

skaldarnar
Copy link
Member

  • feat(geom): create Rectangled/f from point (and set to point)
  • test(geom): test Rectangled/f created from point

Required by Terasology/PolyWorld#35 (tests).

}

/**
* Set this rectangle to be a clone of <code>source</code>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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>.
Copy link
Member

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
Copy link
Member

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>.
Copy link
Member

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>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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>.
Copy link
Member

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?

Copy link
Member Author

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>.
Copy link
Member

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?

Copy link
Member Author

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).

@skaldarnar skaldarnar requested a review from jdrueckert January 26, 2021 21:50
@jdrueckert jdrueckert merged commit e3baf19 into main Jan 26, 2021
@jdrueckert jdrueckert deleted the feat/rectangle-create-from-point branch January 26, 2021 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants