1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

shot: Fix hanging due to zero sized Rect

shot was refactored to retrive crop_region,
but it is empty when -r is not used.
This commit is contained in:
Aziz Berkay Yesilyurt 2021-11-03 21:39:45 +01:00 committed by Andreas Kling
parent 0dae7c9420
commit 7f8794f902

View file

@ -108,7 +108,7 @@ int main(int argc, char** argv)
} }
auto app = GUI::Application::construct(argc, argv); auto app = GUI::Application::construct(argc, argv);
Gfx::IntRect crop_region; Optional<Gfx::IntRect> crop_region;
if (select_region) { if (select_region) {
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();
auto& container = window->set_main_widget<SelectableLayover>(window); auto& container = window->set_main_widget<SelectableLayover>(window);
@ -120,7 +120,7 @@ int main(int argc, char** argv)
app->exec(); app->exec();
crop_region = container.region(); crop_region = container.region();
if (crop_region.is_empty()) { if (crop_region.value().is_empty()) {
dbgln("cancelled..."); dbgln("cancelled...");
return 0; return 0;
} }