From 6d957e9d6511a3b2ae63a4062afc9a7fe688f787 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 --- 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 d0ae01545a..82b7bf2a56 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -3348,8 +3348,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;