From 0ee16339aec3a956ad2c17a92c7b2a79670d890b Mon Sep 17 00:00:00 2001 From: Gary Allen Date: Sun, 10 Jan 2021 18:34:58 +0200 Subject: [PATCH] Fix wxRibbonToolbar Coord Functions --- src/ribbon/toolbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ribbon/toolbar.cpp b/src/ribbon/toolbar.cpp index b434a39a11..3ce8b33b77 100644 --- a/src/ribbon/toolbar.cpp +++ b/src/ribbon/toolbar.cpp @@ -439,7 +439,7 @@ wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos(wxCoord x, wxCoord y)cons for ( size_t t = 0; t < tool_count; ++t ) { wxRibbonToolBarToolBase* tool = group->tools.Item(t); - wxRect rect(tool->position, tool->size); + wxRect rect(tool->position + group->position, tool->size); if(rect.Contains(x, y)) { return tool; @@ -535,7 +535,7 @@ wxRect wxRibbonToolBar::GetToolRect(int tool_id)const wxRibbonToolBarToolBase* tool = group->tools.Item(t); if (tool->id == tool_id) { - wxRect rect(tool->position.x, tool->position.y, tool->size.GetWidth(), tool->size.GetHeight()); + wxRect rect(tool->position + group->position, tool->size); return rect; } ++pos;