[gimp] app: Fix curve application to tilt aspect ratio maping
- From: Alexia Death <alexiade src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Fix curve application to tilt aspect ratio maping
- Date: Sun, 9 May 2010 21:24:42 +0000 (UTC)
commit 74f907ca33677a55adee7473c15b1b1015dcff7f
Author: Alexia Death <alexiadeath gmail com>
Date: Mon May 10 00:14:24 2010 +0300
app: Fix curve application to tilt aspect ratio maping
app/core/gimpdynamicsoutput.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpdynamicsoutput.c b/app/core/gimpdynamicsoutput.c
index af1331d..ac0d869 100644
--- a/app/core/gimpdynamicsoutput.c
+++ b/app/core/gimpdynamicsoutput.c
@@ -624,9 +624,18 @@ gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
if (output->use_tilt)
{
- total += gimp_curve_map_value (output->tilt_curve,
- (sqrt ((1 - fabs (coords->xtilt)) /
- (1 - fabs (coords->ytilt)))));
+ gdouble tilt_value = MIN ((1 - fabs (coords->xtilt)) /
+ (1 - fabs (coords->ytilt)), 20);
+
+ if (tilt_value <= 1.0)
+ tilt_value = gimp_curve_map_value (output->tilt_curve,
+ tilt_value);
+ else
+ tilt_value = (1 - gimp_curve_map_value (output->tilt_curve,
+ (1.0 - (tilt_value - 1.0) / 19.0))) * 19.0 + 1.0 ;
+
+ total += tilt_value;
+
factors++;
}
@@ -668,7 +677,7 @@ gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
g_printerr ("Dynamics queried(aspect). Result: %f, factors: %d, total: %f\n",
result, factors, total);
#endif
- if (result < 0.25) result = 0.25;
+ result = CLAMP (result, 0.05, 20.0);
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]