Skip to content

Commit e35c0ee

Browse files
committed
tool: add CTRL+A shortcut to select the whole in-bound image
1 parent db1c7f4 commit e35c0ee

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/screenshot_tool.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,16 @@ void ScreenshotTool::HandleShortcutsInput()
446446
ImGui::ClearActiveID();
447447
}
448448

449+
if (ImGui::Shortcut(ImGuiKey_A | ImGuiMod_Ctrl, ImGuiInputFlags_RouteGlobal))
450+
{
451+
m_selection.start = point_t{ m_image_origin.x, m_image_origin.y };
452+
453+
m_selection.end = point_t{ m_image_origin.x + static_cast<float>(m_screenshot.w),
454+
m_image_origin.y + static_cast<float>(m_screenshot.h) };
455+
456+
m_state = ToolState::Selected;
457+
}
458+
449459
if (ImGui::Shortcut(ImGuiKey_Z | ImGuiMod_Ctrl, ImGuiInputFlags_RouteGlobal) && !m_annotations.empty())
450460
m_annotations.pop_back();
451461

0 commit comments

Comments
 (0)