mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +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:
parent
0dae7c9420
commit
7f8794f902
Notes:
sideshowbarker
2024-07-18 01:29:10 +09:00
Author: https://github.com/abyesilyurt Commit: https://github.com/SerenityOS/serenity/commit/7f8794f902a Pull-request: https://github.com/SerenityOS/serenity/pull/10788 Reviewed-by: https://github.com/davidot ✅ Reviewed-by: https://github.com/kleinesfilmroellchen ✅
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue