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
This commit is contained in:
Seth Hillbrand 2023-10-29 10:40:08 -07:00
parent e334f11f12
commit 6d957e9d65
1 changed files with 1 additions and 2 deletions

View File

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