[gimp] app: use 0..1 axes in GimpCurveTool's curves widgets on != 8-bit images



commit afb767fcc1da74bf44686443be96851c8201be8f
Author: Michael Natterer <mitch gimp org>
Date:   Thu Jun 13 00:23:49 2013 +0200

    app: use 0..1 axes in GimpCurveTool's curves widgets on != 8-bit images

 app/tools/gimpcurvestool.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index 315a4a7..73db111 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -218,6 +218,17 @@ gimp_curves_tool_initialize (GimpTool     *tool,
                                       histogram);
   g_object_unref (histogram);
 
+  if (gimp_drawable_get_precision (drawable) == GIMP_PRECISION_U8)
+    {
+      gimp_curve_view_set_range_x (GIMP_CURVE_VIEW (c_tool->graph), 0, 255);
+      gimp_curve_view_set_range_y (GIMP_CURVE_VIEW (c_tool->graph), 0, 255);
+    }
+  else
+    {
+      gimp_curve_view_set_range_x (GIMP_CURVE_VIEW (c_tool->graph), 0.0, 1.0);
+      gimp_curve_view_set_range_y (GIMP_CURVE_VIEW (c_tool->graph), 0.0, 1.0);
+    }
+
   return TRUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]