[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9881: Drop the get_parent hack in c
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9881: Drop the get_parent hack in character::set_rotation, only add PI if |
Date: |
Tue, 30 Sep 2008 17:21:01 -0400 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9881
committer: Sandro Santilli <address@hidden>
branch nick: gnash-head
timestamp: Tue 2008-09-30 17:21:01 -0400
message:
Drop the get_parent hack in character::set_rotation, only add PI if
xscale cache is negative, no matter yscale. Fixes the last known failing
tests in matrix_test.swf. We need more tests!
modified:
libcore/character.cpp
testsuite/misc-ming.all/matrix_test.c
=== modified file 'libcore/character.cpp'
--- a/libcore/character.cpp 2008-09-30 15:15:39 +0000
+++ b/libcore/character.cpp 2008-09-30 21:21:01 +0000
@@ -867,27 +867,24 @@
//log_debug("_rotation: %d", rot);
#ifdef USE_MATRIX_CACHES
- _rotation = rot;
double xscale = _xscale / 100.0;
double yscale = _yscale / 100.0;
- double rotation = _rotation * PI / 180.0;
+ double rotation = rot * PI / 180.0;
+
+ //log_debug("xscale cached: %d, yscale cached: %d", _xscale, _yscale);
+
+ if (_xscale < 0 ) // TODO: check if there's any case we should use
_yscale here
+ {
+ rotation += PI;
+ }
matrix m = get_matrix();
-
- //log_debug("xscale cached: %d, yscale cached: %d", _xscale, _yscale);
-
- if (get_parent())
- {
- if (_xscale < 0 || _yscale < 0) rotation += PI;
m.set_rotation(rotation);
- }
- else
- {
- m.set_scale_rotation(xscale, yscale, rotation);
- }
-
- set_matrix(m); // we updated the cache ourselves
+ set_matrix(m); // we update the cache ourselves
+
+ _rotation = rot;
+
#else
double rotation = rot * PI / 180.0;
matrix m = get_matrix();
=== modified file 'testsuite/misc-ming.all/matrix_test.c'
--- a/testsuite/misc-ming.all/matrix_test.c 2008-09-30 20:55:09 +0000
+++ b/testsuite/misc-ming.all/matrix_test.c 2008-09-30 21:21:01 +0000
@@ -1818,14 +1818,14 @@
add_actions(mo, "staticmc._rotation = -90;"); // change _rotation using
ActionScript
check_equals(mo, "printBounds(staticmc.getBounds(_root))",
"'-60.1,-30.05 60.1,30.05'");
- xcheck_equals(mo, "staticmc.transform.matrix.toString()", "'(a=0, b=-1,
c=-2, d=0, tx=0, ty=0)'");
+ check_equals(mo, "staticmc.transform.matrix.toString()", "'(a=0, b=-1,
c=-2, d=0, tx=0, ty=0)'");
check_equals(mo, "staticmc._rotation", "-90");
check_equals(mo, "staticmc._xscale", "100");
check_equals(mo, "staticmc._yscale", "-200");
add_actions(mo, "staticmc._rotation = 90;"); // change _rotation using
ActionScript
check_equals(mo, "printBounds(staticmc.getBounds(_root))",
"'-60.1,-30.05 60.1,30.05'");
- xcheck_equals(mo, "staticmc.transform.matrix.toString()", "'(a=0, b=1,
c=2, d=0, tx=0, ty=0)'");
+ check_equals(mo, "staticmc.transform.matrix.toString()", "'(a=0, b=1,
c=2, d=0, tx=0, ty=0)'");
check_equals(mo, "staticmc._rotation", "90");
check_equals(mo, "staticmc._xscale", "100");
check_equals(mo, "staticmc._yscale", "-200");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9881: Drop the get_parent hack in character::set_rotation, only add PI if,
Sandro Santilli <=