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
Notes: sideshowbarker 2024-07-18 01:29:10 +09:00

View file

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