gimp r25494 - in trunk: . app/display
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25494 - in trunk: . app/display
- Date: Wed, 16 Apr 2008 16:19:28 +0100 (BST)
Author: mitch
Date: Wed Apr 16 16:19:28 2008
New Revision: 25494
URL: http://svn.gnome.org/viewvc/gimp?rev=25494&view=rev
Log:
2008-04-16 Michael Natterer <mitch gimp org>
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): remove local "inertia" variable
and simply modify the passed "inertia_factor" when needed.
Modified:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell-coords.c
Modified: trunk/app/display/gimpdisplayshell-coords.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-coords.c (original)
+++ trunk/app/display/gimpdisplayshell-coords.c Wed Apr 16 16:19:28 2008
@@ -211,18 +211,12 @@
gdouble inertia_factor,
guint32 time)
{
- gdouble inertia;
-
/* Smoothing causes problems with cursor tracking
* when zoomed above screen resolution so we need to supress it.
*/
if (shell->scale_x > 1.0 || shell->scale_y > 1.0)
{
- inertia = 0.0;
- }
- else
- {
- inertia = inertia_factor;
+ inertia_factor = 0.0;
}
if (shell->last_disp_motion_time == 0)
@@ -275,12 +269,12 @@
coords->velocity = MIN (coords->velocity, 1.0);
}
- if (inertia > 0 && coords->distance > 0)
+ if (inertia_factor > 0 && coords->distance > 0)
{
/* Apply smoothing to X and Y. */
/* This tells how far from the pointer can stray from the line */
- gdouble max_deviation = SQR (20 * inertia);
+ gdouble max_deviation = SQR (20 * inertia_factor);
gdouble cur_deviation = max_deviation;
gdouble sin_avg;
gdouble sin_old;
@@ -293,13 +287,13 @@
sin_new = coords->delta_x / coords->distance;
sin_old = shell->last_coords.delta_x / shell->last_coords.distance;
- sin_avg = sin (asin (sin_old) * inertia +
- asin (sin_new) * (1 - inertia));
+ sin_avg = sin (asin (sin_old) * inertia_factor +
+ asin (sin_new) * (1 - inertia_factor));
cos_new = coords->delta_y / coords->distance;
cos_old = shell->last_coords.delta_y / shell->last_coords.distance;
- cos_avg = cos (acos (cos_old) * inertia +
- acos (cos_new) * (1 - inertia));
+ cos_avg = cos (acos (cos_old) * inertia_factor +
+ acos (cos_new) * (1 - inertia_factor));
coords->delta_x = sin_avg * coords->distance;
coords->delta_y = cos_avg * coords->distance;
@@ -338,7 +332,7 @@
shell->last_coords.velocity,
coords->pressure,
coords->distance - dist,
- inertia);
+ inertia_factor);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]