[gimp] app: don't ROUND() all input/output values to int in GimpLevelsTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: don't ROUND() all input/output values to int in GimpLevelsTool
- Date: Mon, 10 Jun 2013 19:53:47 +0000 (UTC)
commit 875b1705fc9fa61fb742c6609f46b1f753c41f29
Author: Michael Natterer <mitch gimp org>
Date: Mon Jun 10 21:51:15 2013 +0200
app: don't ROUND() all input/output values to int in GimpLevelsTool
That was a leftover from before the change to 0..100 sliders for
non-8-bit images. Spoted by Elle Stone.
app/tools/gimplevelstool.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c
index 3215f48..5b1516a 100644
--- a/app/tools/gimplevelstool.c
+++ b/app/tools/gimplevelstool.c
@@ -1056,7 +1056,10 @@ levels_low_input_changed (GtkAdjustment *adjustment,
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (gtk_adjustment_get_value (adjustment));
+ gdouble value = gtk_adjustment_get_value (adjustment);
+
+ if (tool->ui_scale_factor == 255.0)
+ value = ROUND (value);
gtk_adjustment_set_lower (tool->high_input, value);
gtk_adjustment_set_lower (tool->gamma_linear, value);
@@ -1093,7 +1096,10 @@ levels_high_input_changed (GtkAdjustment *adjustment,
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (gtk_adjustment_get_value (adjustment));
+ gdouble value = gtk_adjustment_get_value (adjustment);
+
+ if (tool->ui_scale_factor == 255.0)
+ value = ROUND (value);
gtk_adjustment_set_upper (tool->low_input, value);
gtk_adjustment_set_upper (tool->gamma_linear, value);
@@ -1113,7 +1119,10 @@ levels_low_output_changed (GtkAdjustment *adjustment,
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (gtk_adjustment_get_value (adjustment));
+ gdouble value = gtk_adjustment_get_value (adjustment);
+
+ if (tool->ui_scale_factor == 255.0)
+ value = ROUND (value);
if (config->low_output[config->channel] != value / tool->ui_scale_factor)
{
@@ -1128,7 +1137,10 @@ levels_high_output_changed (GtkAdjustment *adjustment,
GimpLevelsTool *tool)
{
GimpLevelsConfig *config = tool->config;
- gint value = ROUND (gtk_adjustment_get_value (adjustment));
+ gdouble value = gtk_adjustment_get_value (adjustment);
+
+ if (tool->ui_scale_factor == 255.0)
+ value = ROUND (value);
if (config->high_output[config->channel] != value / tool->ui_scale_factor)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]