Don't use KiROUND when we should trunc

When calculating the viewport extents, we only need the maximum size
that can be represented.  Anything larger should be truncated.  We do
this in many other places (wx_view_controls, ruler_item,
ds_proxy_view_item, etc) and this brings pcb_selection_tool into
alignment with this, avoiding an unneeded warning message

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15529

(cherry picked from commit 6d957e9d65)
This commit is contained in:
Seth Hillbrand 2023-10-29 10:40:08 -07:00
parent c3fef1cae2
commit 9ac006b114
1 changed files with 1 additions and 2 deletions

View File

@ -3210,8 +3210,7 @@ void PCB_SELECTION_TOOL::FilterCollectorForFootprints( GENERAL_COLLECTOR& aColle
{
const RENDER_SETTINGS* settings = getView()->GetPainter()->GetSettings();
BOX2D viewport = getView()->GetViewport();
BOX2I extents( { KiROUND( viewport.GetPosition().x ), KiROUND( viewport.GetPosition().y ) },
{ KiROUND( viewport.GetSize().x ), KiROUND( viewport.GetSize().y ) } );
BOX2I extents( viewport.GetPosition(), viewport.GetSize() );
bool need_direct_hit = false;
FOOTPRINT* single_fp = nullptr;