Skip to content

Commit 3ba2e4b

Browse files
committed
crop: Do alignment only if ratio_d and ratio_n are not 0.
This is important to avoid divide by zero while trying to align the crop area. Fixes #19428
1 parent 1789bb0 commit 3ba2e4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/iop/crop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ static void _event_aspect_presets_changed(GtkWidget *combo, dt_iop_module_t *sel
911911
p->ratio_d = -d;
912912

913913
p->ratio_n = n;
914-
p->aligned = p->ratio_d != 0 || p->ratio_n != 0;
914+
p->aligned = p->ratio_d != 0 && p->ratio_n != 0;
915915

916916
dt_conf_set_int("plugins/darkroom/crop/ratio_d", abs(p->ratio_d));
917917
dt_conf_set_int("plugins/darkroom/crop/ratio_n", abs(p->ratio_n));

0 commit comments

Comments
 (0)