7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 23:05:33 +00:00

spread_footprints.cpp, SpreadFootprints(): fix incorrect conversion int to uint64

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19780
This commit is contained in:
jean-pierre charras 2025-01-29 19:43:17 +01:00
parent 3baa6cd791
commit 799ea8317d

View File

@ -121,7 +121,7 @@ std::optional<rectpack2D::rect_wh> spreadRectangles( rect_vector& vecSubRects, i
return result;
}
#include <wx/log.h>
void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, VECTOR2I aTargetBoxPosition,
bool aGroupBySheet, int aComponentGap, int aGroupGap )
{
@ -305,10 +305,10 @@ void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, VECTOR2I aTargetBox
// Avoid too large coordinates: Overlapping components
// are better than out of screen components
if( (uint64_t) target_pos.x + (uint64_t) target_size.x > INT_MAX / 2 )
if( (int64_t) target_pos.x + (int64_t) target_size.x > INT_MAX / 2 )
target_pos.x -= INT_MAX / 2;
if( (uint64_t) target_pos.y + (uint64_t) target_size.y > INT_MAX / 2 )
if( (int64_t) target_pos.y + (int64_t) target_size.y > INT_MAX / 2 )
target_pos.y -= INT_MAX / 2;
for( auto& [fpSize, fpPair] : sizeToFpMap )