[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/shape.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/shape.cpp |
Date: |
Fri, 09 Nov 2007 21:27:49 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/11/09 21:27:49
Modified files:
. : ChangeLog
server : shape.cpp
Log message:
Fixed silly bug checking for lines connecting origin with end of each
edge
rather then all edges. Prepared (but not implemented) section for
curves.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4818&r2=1.4819
http://cvs.savannah.gnu.org/viewcvs/gnash/server/shape.cpp?cvsroot=gnash&r1=1.43&r2=1.44
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4818
retrieving revision 1.4819
diff -u -b -r1.4818 -r1.4819
--- ChangeLog 9 Nov 2007 19:58:02 -0000 1.4818
+++ ChangeLog 9 Nov 2007 21:27:48 -0000 1.4819
@@ -1,5 +1,11 @@
2007-11-09 Sandro Santilli <address@hidden>
+ * server/shape.cpp (withinSquareDistance): fixed silly bug checking
+ for lines connecting origin with end of each edge rather then
+ all edges. Prepared (but not implemented) section for curves.
+
+2007-11-09 Sandro Santilli <address@hidden>
+
* server/character.{cpp,h}: Add level argument to queueEvent method
* server/movie_root.{cpp,h}: Add level argument to pushAction*
* server/sprite_instance.cpp: Push actions with a level
Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- server/shape.cpp 7 Nov 2007 12:08:16 -0000 1.43
+++ server/shape.cpp 9 Nov 2007 21:27:49 -0000 1.44
@@ -370,18 +370,31 @@
if ( ! nedges ) return false;
- // TODO: FIXME: we're not considering the control
- // point at all so the check will only work
- // for straight lines
-
point px(m_ax, m_ay);
for (size_t i=0; i<nedges; ++i)
{
const edge& e = m_edges[i];
point np(e.m_ax, e.m_ay);
+
+ if ( e.is_straight() )
+ {
float d = edge::squareDistancePtSeg(p, px, np);
if ( d < dist ) return true;
}
+ else
+ {
+
+ // TODO: FIXME: we're not considering the control
+ // point at all so the check will only work
+ // for straight lines
+ // TODO: for curves...
+ // d(t)=(x(t)-a)^2+(y(t)-b)^2,
+ float d = edge::squareDistancePtSeg(p, px, np);
+ if ( d < dist ) return true;
+ }
+
+ px = np;
+ }
return false;
}