From bc73232cd9a80cab455284fecb9aee93036afe18 Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 3 Aug 2024 01:46:07 +0200 Subject: [PATCH] app, libgimpwidgets: fix CRITICAL on NULL GimpUnit. I missed this one because it was using 0 instead of the GIMP_UNIT_PIXEL macro. This was triggering CRITICALs when using the text tool. --- app/widgets/gimptextstyleeditor.c | 2 +- libgimpwidgets/gimpsizeentry.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/widgets/gimptextstyleeditor.c b/app/widgets/gimptextstyleeditor.c index 3405d7536f..d0d8e34752 100644 --- a/app/widgets/gimptextstyleeditor.c +++ b/app/widgets/gimptextstyleeditor.c @@ -211,7 +211,7 @@ gimp_text_style_editor_init (GimpTextStyleEditor *editor) _("Change font of selected text"), NULL); editor->size_entry = - gimp_size_entry_new (1, 0, "%a", TRUE, FALSE, FALSE, 10, + gimp_size_entry_new (1, gimp_unit_pixel (), "%a", TRUE, FALSE, FALSE, 10, GIMP_SIZE_ENTRY_UPDATE_SIZE); gtk_box_pack_start (GTK_BOX (editor->upper_hbox), editor->size_entry, FALSE, FALSE, 0); diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c index f11d1fe179..1c3929b197 100644 --- a/libgimpwidgets/gimpsizeentry.c +++ b/libgimpwidgets/gimpsizeentry.c @@ -282,6 +282,7 @@ gimp_size_entry_new (gint number_of_fields, GimpUnitStore *store; gint i; + g_return_val_if_fail (GIMP_IS_UNIT (unit), NULL); g_return_val_if_fail ((number_of_fields >= 0) && (number_of_fields <= 16), NULL);