From cd3a0e3324a1d4ab56681637471ff7bb16bbcaf9 Mon Sep 17 00:00:00 2001 From: Piyush Mishra Date: Fri, 14 Jan 2022 19:10:01 +0530 Subject: [PATCH] Fix: crop wasn't working after save --- src/draw_thread.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/draw_thread.rs b/src/draw_thread.rs index 8e66b4b..34e2507 100644 --- a/src/draw_thread.rs +++ b/src/draw_thread.rs @@ -193,17 +193,14 @@ fn load_image( prop.rgba = saved_prop.rgba; prop.is_saved = true; use_defaults = false; - let saved = prop.is_saved; drop(prop); - if saved { - if let Some((x, y)) = saved_prop.crop_position { - cont.apply_crop_pos(x, y); - } - } else { - match crop { + + match crop { + Some((x, y)) => cont.apply_crop_pos(x, y), + None => match saved_prop.crop_position { Some((x, y)) => cont.apply_crop_pos(x, y), None => cont.apply_crop(), - } + }, } } }