mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-07 22:05:32 +00:00
BOX2: Correct a clamp
std::clamp is (v, min, max), but alg::clamp is (min, v, max). I can't quite get my head round why this only causes test failures on some platforms.
This commit is contained in:
parent
55370e7520
commit
58669f2b9f
@ -855,8 +855,8 @@ public:
|
||||
me.Normalize(); // ensure size is >= 0
|
||||
|
||||
// Determine closest point to the circle centre within this rect
|
||||
const coord_type nx = std::clamp( me.GetLeft(), aPoint.x, me.GetRight() );
|
||||
const coord_type ny = std::clamp( me.GetTop(), aPoint.y, me.GetBottom() );
|
||||
const coord_type nx = std::clamp( aPoint.x, me.GetLeft(), me.GetRight() );
|
||||
const coord_type ny = std::clamp( aPoint.y, me.GetTop(), me.GetBottom() );
|
||||
|
||||
return Vec( nx, ny );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user