[gimp] Complete removal of pressure and velocity scale defines



commit a2f9408196b30356662ecd0ebc0ab99fffce406d
Author: SHIRAKAWA Akira <shirakawa devel gmail com>
Date:   Thu Oct 8 22:53:18 2009 +0200

    Complete removal of pressure and velocity scale defines
    
    As tablet pen pressure and velocity scales when set to 1.0 lose their meaning,
    their defines have been completely eliminated from the GIMP source.

 app/paint/gimpairbrush.c        |    4 ++--
 app/paint/gimppaintoptions.c    |   20 ++++++++++----------
 app/paint/gimppaintoptions.h    |    3 ---
 devel-docs/app/app-sections.txt |    2 --
 4 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c
index 9d03136..f78a5b8 100644
--- a/app/paint/gimpairbrush.c
+++ b/app/paint/gimpairbrush.c
@@ -189,10 +189,10 @@ gimp_airbrush_motion (GimpPaintCore    *paint_core,
   saved_velocity = paint_options->velocity_options->hardness;
 
   if (saved_pressure)
-    opacity *= GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+    opacity *= coords->pressure;
 
   if (saved_velocity)
-    opacity *= MAX (0.0, 1 - GIMP_PAINT_VELOCITY_SCALE * coords->velocity);
+    opacity *= MAX (0.0, coords->velocity);
 
   paint_options->pressure_options->hardness = FALSE;
   paint_options->velocity_options->hardness = FALSE;
diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c
index 926c958..6a444a1 100644
--- a/app/paint/gimppaintoptions.c
+++ b/app/paint/gimppaintoptions.c
@@ -1469,10 +1469,10 @@ gimp_paint_options_get_dynamic_opacity (GimpPaintOptions *paint_options,
 
 
       if (paint_options->pressure_options->opacity)
-        pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+        pressure = coords->pressure;
 
       if (paint_options->velocity_options->opacity)
-        velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
+        velocity = 1 - coords->velocity;
 
       if (paint_options->random_options->opacity)
         random = g_random_double_range (0.0, 1.0);
@@ -1665,10 +1665,10 @@ gimp_paint_options_get_dynamic_rate (GimpPaintOptions *paint_options,
       gdouble tilt      = -1.0;
 
       if (paint_options->pressure_options->rate)
-        pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+        pressure = coords->pressure;
 
       if (paint_options->velocity_options->rate)
-        velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
+        velocity = 1 - coords->velocity;
 
       if (paint_options->random_options->rate)
         random = g_random_double_range (0.0, 1.0);
@@ -1717,10 +1717,10 @@ gimp_paint_options_get_dynamic_color (GimpPaintOptions *paint_options,
       gdouble tilt      = -1.0;
 
       if (paint_options->pressure_options->color)
-        pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+        pressure = coords->pressure;
 
       if (paint_options->velocity_options->color)
-        velocity = GIMP_PAINT_VELOCITY_SCALE * coords->velocity;
+        velocity = coords->velocity;
 
       if (paint_options->random_options->color)
         random = g_random_double_range (0.0, 1.0);
@@ -1768,10 +1768,10 @@ gimp_paint_options_get_dynamic_hardness (GimpPaintOptions *paint_options,
       gdouble tilt      = -1.0;
 
       if (paint_options->pressure_options->hardness)
-        pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+        pressure = coords->pressure;
 
       if (paint_options->velocity_options->hardness)
-        velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
+        velocity = 1 - coords->velocity;
 
       if (paint_options->random_options->hardness)
         random = g_random_double_range (0.0, 1.0);
@@ -1819,10 +1819,10 @@ gimp_paint_options_get_dynamic_angle (GimpPaintOptions *paint_options,
       gdouble tilt      = -1.0;
 
       if (paint_options->pressure_options->angle)
-        pressure = GIMP_PAINT_PRESSURE_SCALE * coords->pressure;
+        pressure = coords->pressure;
 
       if (paint_options->velocity_options->angle)
-        velocity = GIMP_PAINT_VELOCITY_SCALE * (1 - coords->velocity);
+        velocity = 1 - coords->velocity;
 
       if (paint_options->random_options->angle)
         random = g_random_double_range (0.0, 1.0);
diff --git a/app/paint/gimppaintoptions.h b/app/paint/gimppaintoptions.h
index e21b928..70e0880 100644
--- a/app/paint/gimppaintoptions.h
+++ b/app/paint/gimppaintoptions.h
@@ -77,9 +77,6 @@ struct _GimpGradientOptions
 #define GIMP_IS_PAINT_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_PAINT_OPTIONS))
 #define GIMP_PAINT_OPTIONS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_PAINT_OPTIONS, GimpPaintOptionsClass))
 
-#define GIMP_PAINT_PRESSURE_SCALE 1.0
-#define GIMP_PAINT_VELOCITY_SCALE 1.0
-
 typedef struct _GimpPaintOptionsClass GimpPaintOptionsClass;
 
 struct _GimpPaintOptions
diff --git a/devel-docs/app/app-sections.txt b/devel-docs/app/app-sections.txt
index 0b55e15..983091e 100644
--- a/devel-docs/app/app-sections.txt
+++ b/devel-docs/app/app-sections.txt
@@ -3722,8 +3722,6 @@ GimpDynamicOptions
 GimpFadeOptions
 GimpGradientOptions
 GimpJitterOptions
-GIMP_PAINT_PRESSURE_SCALE
-GIMP_PAINT_VELOCITY_SCALE
 <TITLE>GimpPaintOptions</TITLE>
 GimpPaintOptions
 gimp_paint_options_new



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