From 43c8ecd77f365c1055dd7632ea5304b7014daa55 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Wed, 3 Jan 2024 19:49:05 +0100 Subject: [PATCH] PCB_TOOL_BASE: allow casting the frame to types other than PCB_BASE_DRAW_FRAME. This is useful when testing pcbnew's TOOLs outside the real pcbnew window (example: P&S log viewer/playground), as with the default cast, all of pcbnew UI would have to be linked in for the tests to build. --- pcbnew/tools/pcb_tool_base.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/pcb_tool_base.h b/pcbnew/tools/pcb_tool_base.h index 16076f5afb..36a2ef6188 100644 --- a/pcbnew/tools/pcb_tool_base.h +++ b/pcbnew/tools/pcb_tool_base.h @@ -162,9 +162,10 @@ protected: return getViewControls(); } - PCB_BASE_EDIT_FRAME* frame() const + template + T* frame() const { - return getEditFrame(); + return getEditFrame(); } BOARD* board() const { return getModel(); }