[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/matrix.cpp server/matrix...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/matrix.cpp server/matrix... |
Date: |
Sat, 14 Apr 2007 14:38:29 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/04/14 14:38:29
Modified files:
. : ChangeLog
server : matrix.cpp matrix.h
testsuite/actionscript.all: MovieClip.as
testsuite/misc-ming.all: displaylist_depths_test.c
Log message:
Range2d transform was still bogues, this fix seems better
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2870&r2=1.2871
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/matrix.h?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/actionscript.all/MovieClip.as?cvsroot=gnash&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/displaylist_depths_test.c?cvsroot=gnash&r1=1.7&r2=1.8
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2870
retrieving revision 1.2871
diff -u -b -r1.2870 -r1.2871
--- ChangeLog 14 Apr 2007 13:28:31 -0000 1.2870
+++ ChangeLog 14 Apr 2007 14:38:28 -0000 1.2871
@@ -1,9 +1,9 @@
2007-04-12 Sandro Santilli <address@hidden>
- * server/matrix.cpp: fix conceptual bug in Range2d transform
+ * server/matrix.{h,cpp}: fix conceptual bug in Range2d transform
function.
- * testsuite/actionscript.all/MovieClip.as: one unexpected
- success when fetching _height.
+ * testsuite/misc-ming.all/displaylist_depths_test.c,
+ testsuite/actionscript.all/MovieClip.as: more successes.
2007-04-12 Bastiaan Jacques <address@hidden>
Index: server/matrix.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- server/matrix.cpp 14 Apr 2007 13:28:32 -0000 1.9
+++ server/matrix.cpp 14 Apr 2007 14:38:28 -0000 1.10
@@ -18,7 +18,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.cpp,v 1.9 2007/04/14 13:28:32 strk Exp $
+// $Id: matrix.cpp,v 1.10 2007/04/14 14:38:28 strk Exp $
//
#ifdef HAVE_CONFIG_H
@@ -218,6 +218,16 @@
}
void
+matrix::transform(point& p) const
+// Transform point 'p' by our matrix.
+{
+ float nx = m_[0][0] * p.m_x + m_[0][1] * p.m_y + m_[0][2];
+ float ny = m_[1][0] * p.m_x + m_[1][1] * p.m_y + m_[1][2];
+ p.m_x = nx;
+ p.m_y = ny;
+}
+
+void
matrix::transform(geometry::Range2d<float>& r) const
{
if ( ! r.isFinite() ) return;
@@ -227,17 +237,20 @@
float ymin = r.getMinY();
float ymax = r.getMaxY();
- float n_xmin = m_[0][0] * xmin + m_[0][1] * ymin + m_[0][2];
- float n_ymin = m_[1][0] * xmin + m_[1][1] * ymin + m_[1][2];
-
- float n_xmax = m_[0][0] * xmax + m_[0][1] * ymax + m_[0][2];
- float n_ymax = m_[1][0] * xmax + m_[1][1] * ymax + m_[1][2];
-
- // Rotation can swap the max/min coordinates
- if ( n_xmax < n_xmin ) std::swap(n_xmin, n_xmax);
- if ( n_ymax < n_ymin ) std::swap(n_ymin, n_ymax);
-
- r.setTo(n_xmin, n_ymin, n_xmax, n_ymax);
+ point p0(xmin, ymin);
+ point p1(xmin, ymax);
+ point p2(xmax, ymax);
+ point p3(xmax, ymin);
+
+ transform(p0);
+ transform(p1);
+ transform(p2);
+ transform(p3);
+
+ r.setTo(p0.m_x, p0.m_y);
+ r.expandTo(p1.m_x, p1.m_y);
+ r.expandTo(p2.m_x, p2.m_y);
+ r.expandTo(p3.m_x, p3.m_y);
}
void
Index: server/matrix.h
===================================================================
RCS file: /sources/gnash/gnash/server/matrix.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/matrix.h 12 Apr 2007 09:14:36 -0000 1.5
+++ server/matrix.h 14 Apr 2007 14:38:28 -0000 1.6
@@ -18,7 +18,7 @@
//
// Original author: Thatcher Ulrich <address@hidden> 2003
//
-// $Id: matrix.h,v 1.5 2007/04/12 09:14:36 strk Exp $
+// $Id: matrix.h,v 1.6 2007/04/14 14:38:28 strk Exp $
//
#ifndef GNASH_MATRIX_H
@@ -124,6 +124,9 @@
///
void transform(point* result, const point& p) const;
+ /// Transform point 'p' by our matrix.
+ void transform(point& p) const;
+
/// Transform vector 'v' by our matrix. Doesn't apply translation.
//
/// Put the result in *result.
Index: testsuite/actionscript.all/MovieClip.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/actionscript.all/MovieClip.as,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- testsuite/actionscript.all/MovieClip.as 14 Apr 2007 13:28:32 -0000
1.55
+++ testsuite/actionscript.all/MovieClip.as 14 Apr 2007 14:38:29 -0000
1.56
@@ -22,7 +22,7 @@
// compile this test case with Ming makeswf, and then
// execute it like this gnash -1 -r 0 -v out.swf
-rcsid="$Id: MovieClip.as,v 1.55 2007/04/14 13:28:32 strk Exp $";
+rcsid="$Id: MovieClip.as,v 1.56 2007/04/14 14:38:29 strk Exp $";
#include "check.as"
@@ -576,7 +576,7 @@
draw._rotation = 90;
check_equals(draw._width, 20);
-xcheck_equals(draw._height, 10);
+check_equals(draw._height, 10);
b = draw.getBounds(); // these are local, untransformed
check_equals(b.xMin, 10);
check_equals(b.xMax, 20);
@@ -586,11 +586,11 @@
check_equals(b.xMin, -30);
xcheck_equals(b.xMax, -10);
xcheck_equals(b.yMin, 10);
-xcheck_equals(b.yMax, 20);
+check_equals(b.yMax, 20);
draw._visible = false;
check_equals(draw._width, 20);
-xcheck_equals(draw._height, 10);
+check_equals(draw._height, 10);
b = draw.getBounds(); // these are local, untransformed
check_equals(b.xMin, 10);
check_equals(b.xMax, 20);
@@ -600,7 +600,7 @@
check_equals(b.xMin, -30);
xcheck_equals(b.xMax, -10);
xcheck_equals(b.yMin, 10);
-xcheck_equals(b.yMax, 20);
+check_equals(b.yMax, 20);
draw._xscale = 200;
check_equals(draw._width, 20);
Index: testsuite/misc-ming.all/displaylist_depths_test.c
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/displaylist_depths_test.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- testsuite/misc-ming.all/displaylist_depths_test.c 12 Apr 2007 09:46:07
-0000 1.7
+++ testsuite/misc-ming.all/displaylist_depths_test.c 14 Apr 2007 14:38:29
-0000 1.8
@@ -230,7 +230,7 @@
// And (but only for the static case) child duplication
check_equals(mo, "staticmc_dup._width", "staticmc._width");
- xcheck_equals(mo, "parseInt(staticmc_dup._width/10)", "7");
+ check_equals(mo, "parseInt(staticmc_dup._width/10)", "7");
check_equals(mo, "typeof(staticmc.child)", "'movieclip'");
check_equals(mo, "typeof(staticmc_dup.child)", "'movieclip'");
@@ -274,7 +274,7 @@
// Note that staticmc0_dup is at negative depth
check_equals(mo, "staticmc0_dup._width", "staticmc0._width");
- xcheck_equals(mo, "parseInt(staticmc0._width/10)", "7");
+ check_equals(mo, "parseInt(staticmc0._width/10)", "7");
check_equals(mo, "typeof(staticmc0.child)", "'movieclip'");
check_equals(mo, "typeof(staticmc0_dup.child)", "'movieclip'");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash ChangeLog server/matrix.cpp server/matrix...,
Sandro Santilli <=