[gimp/soc-2010-cage-2] gimpvector: correct normal vector computing, vector wasn't normilized
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2010-cage-2] gimpvector: correct normal vector computing, vector wasn't normilized
- Date: Sat, 14 Aug 2010 19:27:37 +0000 (UTC)
commit 7655a45d61d6619243589dd440c692907166d159
Author: Michael Muré <batolettre gmail com>
Date: Sat Aug 14 21:24:59 2010 +0200
gimpvector: correct normal vector computing, vector wasn't normilized
libgimpmath/gimpvector.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/libgimpmath/gimpvector.c b/libgimpmath/gimpvector.c
index bb53182..63276c4 100644
--- a/libgimpmath/gimpvector.c
+++ b/libgimpmath/gimpvector.c
@@ -463,12 +463,12 @@ GimpVector2
gimp_vector2_normal (GimpVector2 *vector)
{
GimpVector2 result;
-
- result.x = vector->y;
- result.y = - vector->x;
-
- gimp_vector2_normalize (vector);
-
+
+ result.x = - vector->y;
+ result.y = vector->x;
+
+ gimp_vector2_normalize (&result);
+
return result;
}
@@ -485,12 +485,12 @@ GimpVector2
gimp_vector2_normal_val (GimpVector2 vector)
{
GimpVector2 result;
-
- result.x = vector.y;
- result.y = - vector.x;
-
+
+ result.x = - vector.y;
+ result.y = vector.x;
+
gimp_vector2_normalize (&result);
-
+
return result;
}
/**************************************/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]