fix for getting name of gizmo without key(like simplify)

This commit is contained in:
Filip Sykala 2021-09-29 18:17:19 +02:00
parent 88c701888d
commit 95fc054590

View File

@ -237,9 +237,8 @@ void GLGizmoBase::render_input_window(float x, float y, float bottom_limit)
std::string GLGizmoBase::get_name(bool include_shortcut) const std::string GLGizmoBase::get_name(bool include_shortcut) const
{ {
int key = get_shortcut_key(); int key = get_shortcut_key();
assert( key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z);
std::string out = on_get_name(); std::string out = on_get_name();
if (include_shortcut) if (include_shortcut && key >= WXK_CONTROL_A && key <= WXK_CONTROL_Z)
out += std::string(" [") + char(int('A') + key - int(WXK_CONTROL_A)) + "]"; out += std::string(" [") + char(int('A') + key - int(WXK_CONTROL_A)) + "]";
return out; return out;
} }