Skip to content

Commit

Permalink
Fix Rectangle2d::FindNearestPoint()
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Jun 2, 2024
1 parent 67a1784 commit 2dfbfc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wpimath/src/main/native/include/frc/geometry/Rectangle2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ class Rectangle2d {

// Find nearest point
rotPoint =
Translation2d{std::clamp(point.X(), m_center.X() - m_xWidth / 2.0,
Translation2d{std::clamp(rotPoint.X(), m_center.X() - m_xWidth / 2.0,
m_center.X() + m_xWidth / 2.0),
std::clamp(point.Y(), m_center.Y() - m_yWidth / 2.0,
std::clamp(rotPoint.Y(), m_center.Y() - m_yWidth / 2.0,
m_center.Y() + m_yWidth / 2.0)};

// Undo rotation
Expand Down

0 comments on commit 2dfbfc6

Please sign in to comment.