From 5c1a27488f30af06b24215a5f698f85dc9d5584f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Jan 2021 19:26:33 +0100 Subject: [PATCH] Express tool position rectangle position consistently Use tool position as offset from group position and not vice versa, both because this was already done like this in the other places and because this makes more sense: the tool is inside the group, so its position is relative to it. No real changes. --- 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 2002fe1bc5..2e49fd7ce0 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 + group->position, tool->size); + wxRect rect(group->position + tool->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) { - return wxRect(tool->position + group->position, tool->size); + return wxRect(group->position + tool->position, tool->size); } ++pos; }