[gimp] libgimpwidgets: use default unit for eevl ratio quantity in size boxes
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: use default unit for eevl ratio quantity in size boxes
- Date: Thu, 5 Oct 2017 12:54:28 +0000 (UTC)
commit 9fee677b5ca24a433b5e29a407a314e29813e9e3
Author: Ell <ell_se yahoo com>
Date: Thu Oct 5 08:50:34 2017 -0400
libgimpwidgets: use default unit for eevl ratio quantity in size boxes
Pass the ratio quantity to be used for eevl ratio expressions in
terms of the default unit of the size box, instead of as a
dimensionless value.
libgimpwidgets/gimpsizeentry.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgimpwidgets/gimpsizeentry.c b/libgimpwidgets/gimpsizeentry.c
index 1f82fee..85133b7 100644
--- a/libgimpwidgets/gimpsizeentry.c
+++ b/libgimpwidgets/gimpsizeentry.c
@@ -1286,6 +1286,7 @@ gimp_size_entry_eevl_input_callback (GtkSpinButton *spinner,
if (gsef->gse->number_of_fields == 2)
{
GimpSizeEntryField *other_gsef;
+ GimpEevlQuantity default_unit_factor;
options.ratio_expressions = TRUE;
@@ -1302,8 +1303,11 @@ gimp_size_entry_eevl_input_callback (GtkSpinButton *spinner,
options.ratio_invert = TRUE;
}
- options.ratio_quantity.value = other_gsef->value;
- options.ratio_quantity.dimension = 0;
+ options.unit_resolver_proc (NULL, &default_unit_factor, options.data);
+
+ options.ratio_quantity.value = other_gsef->value /
+ default_unit_factor.value;
+ options.ratio_quantity.dimension = default_unit_factor.dimension;
}
success = gimp_eevl_evaluate (gtk_entry_get_text (GTK_ENTRY (spinner)),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]