From 9ac006b1143feeac97a5ae498e19377b2b1de4da Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 29 Oct 2023 10:40:08 -0700 Subject: [PATCH] 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 6d957e9d6511a3b2ae63a4062afc9a7fe688f787) --- pcbnew/tools/pcb_selection_tool.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index cf75a82fbd..5da655bdb1 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -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;