~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/core/gimpcoords.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
{
45
45
  if (b)
46
46
    {
47
 
      ret_val->x        = amul * a->x        + bmul * b->x ;
48
 
      ret_val->y        = amul * a->y        + bmul * b->y ;
49
 
      ret_val->pressure = amul * a->pressure + bmul * b->pressure ;
50
 
      ret_val->xtilt    = amul * a->xtilt    + bmul * b->xtilt ;
51
 
      ret_val->ytilt    = amul * a->ytilt    + bmul * b->ytilt ;
52
 
      ret_val->wheel    = amul * a->wheel    + bmul * b->wheel ;
 
47
      ret_val->x        = amul * a->x        + bmul * b->x;
 
48
      ret_val->y        = amul * a->y        + bmul * b->y;
 
49
      ret_val->pressure = amul * a->pressure + bmul * b->pressure;
 
50
      ret_val->xtilt    = amul * a->xtilt    + bmul * b->xtilt;
 
51
      ret_val->ytilt    = amul * a->ytilt    + bmul * b->ytilt;
 
52
      ret_val->wheel    = amul * a->wheel    + bmul * b->wheel;
 
53
      ret_val->velocity = amul * a->velocity + bmul * b->velocity;
53
54
    }
54
55
  else
55
56
    {
59
60
      ret_val->xtilt    = amul * a->xtilt;
60
61
      ret_val->ytilt    = amul * a->ytilt;
61
62
      ret_val->wheel    = amul * a->wheel;
 
63
      ret_val->velocity = amul * a->velocity;
62
64
    }
63
65
}
64
66
 
118
120
          a->pressure * b->pressure +
119
121
          a->xtilt    * b->xtilt    +
120
122
          a->ytilt    * b->ytilt    +
121
 
          a->wheel    * b->wheel   );
 
123
          a->wheel    * b->wheel    +
 
124
          a->velocity * a->velocity);
122
125
}
123
126
 
124
127
 
139
142
  upscaled_a.xtilt    = a->xtilt    * INPUT_RESOLUTION;
140
143
  upscaled_a.ytilt    = a->ytilt    * INPUT_RESOLUTION;
141
144
  upscaled_a.wheel    = a->wheel    * INPUT_RESOLUTION;
 
145
  upscaled_a.velocity = a->velocity * INPUT_RESOLUTION;
142
146
 
143
147
  return gimp_coords_scalarprod (&upscaled_a, &upscaled_a);
144
148
}
165
169
  dist += ABS (a->xtilt - b->xtilt);
166
170
  dist += ABS (a->ytilt - b->ytilt);
167
171
  dist += ABS (a->wheel - b->wheel);
 
172
  dist += ABS (a->velocity - b->velocity);
168
173
 
169
174
  dist *= INPUT_RESOLUTION;
170
175
 
183
188
          a->pressure == b->pressure &&
184
189
             a->xtilt == b->xtilt    &&
185
190
             a->ytilt == b->ytilt    &&
186
 
             a->wheel == b->wheel);
 
191
             a->wheel == b->wheel    &&
 
192
          a->velocity == b->velocity);
187
193
}