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.
This commit is contained in:
@@ -439,7 +439,7 @@ wxRibbonToolBarToolBase* wxRibbonToolBar::GetToolByPos(wxCoord x, wxCoord y)cons
|
|||||||
for ( size_t t = 0; t < tool_count; ++t )
|
for ( size_t t = 0; t < tool_count; ++t )
|
||||||
{
|
{
|
||||||
wxRibbonToolBarToolBase* tool = group->tools.Item(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))
|
if(rect.Contains(x, y))
|
||||||
{
|
{
|
||||||
return tool;
|
return tool;
|
||||||
@@ -535,7 +535,7 @@ wxRect wxRibbonToolBar::GetToolRect(int tool_id)const
|
|||||||
wxRibbonToolBarToolBase* tool = group->tools.Item(t);
|
wxRibbonToolBarToolBase* tool = group->tools.Item(t);
|
||||||
if (tool->id == tool_id)
|
if (tool->id == tool_id)
|
||||||
{
|
{
|
||||||
return wxRect(tool->position + group->position, tool->size);
|
return wxRect(group->position + tool->position, tool->size);
|
||||||
}
|
}
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user