Update the visual tool buttons when the active tool is changed via hotkey

Originally committed to SVN as r6424.
This commit is contained in:
Thomas Goyne 2012-02-01 18:47:37 +00:00
parent 4ea45627b5
commit 9dbfe5d8e5
2 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ namespace {
if (commands[i]->Type() & cmd::COMMAND_VALIDATE) {
EnableTool(TOOL_ID_BASE + i, commands[i]->Validate(context));
}
if (commands[i]->Type() & cmd::COMMAND_TOGGLE) {
if (commands[i]->Type() & cmd::COMMAND_TOGGLE || commands[i]->Type() & cmd::COMMAND_RADIO) {
ToggleTool(TOOL_ID_BASE + i, commands[i]->IsActive(context));
}
}

View File

@ -433,7 +433,7 @@ void VideoDisplay::SetTool(VisualToolBase *new_tool) {
}
bool VideoDisplay::ToolIsType(std::type_info const& type) const {
return typeid(*tool) == type;
return tool && typeid(*tool) == type;
}
Vector2D VideoDisplay::GetMousePosition() const {