[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9742: - Allow MovieClip.getBounds t
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9742: - Allow MovieClip.getBounds to be called for any character and with |
Date: |
Mon, 15 Sep 2008 12:53:31 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9742
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Mon 2008-09-15 12:53:31 +0200
message:
- Allow MovieClip.getBounds to be called for any character and with
any character as first arg
- Add more tests to TextField.as
- Fix debugging output of SharedObjectTestRunner
modified:
libcore/sprite_instance.cpp
testsuite/actionscript.all/TextField.as
testsuite/misc-ming.all/SharedObjectTestRunner.sh
------------------------------------------------------------
revno: 9740.1.2
committer: Sandro Santilli <address@hidden>
branch nick: mybranch
timestamp: Mon 2008-09-15 11:59:50 +0200
message:
Test calling getBounds against a TextField (and fix support for it)
modified:
libcore/sprite_instance.cpp
testsuite/actionscript.all/TextField.as
------------------------------------------------------------
revno: 9740.1.3
committer: Sandro Santilli <address@hidden>
branch nick: mybranch
timestamp: Mon 2008-09-15 12:53:00 +0200
message:
Fix debug output
modified:
testsuite/misc-ming.all/SharedObjectTestRunner.sh
=== modified file 'libcore/sprite_instance.cpp'
--- a/libcore/sprite_instance.cpp 2008-09-04 15:32:42 +0000
+++ b/libcore/sprite_instance.cpp 2008-09-15 09:59:50 +0000
@@ -1040,18 +1040,18 @@
static as_value
sprite_getBounds(const fn_call& fn)
{
- boost::intrusive_ptr<sprite_instance> sprite =
ensureType<sprite_instance>(fn.this_ptr);
+ boost::intrusive_ptr<character> sprite = ensureType<character>(fn.this_ptr);
rect bounds = sprite->getBounds();
if ( fn.nargs > 0 )
{
- boost::intrusive_ptr<sprite_instance> target = fn.arg(0).to_sprite();
+ character* target = fn.arg(0).to_character();
if ( ! target )
{
IF_VERBOSE_ASCODING_ERRORS(
- log_aserror(_("MovieClip.getBounds(%s): invalid call, first arg must be
a sprite"),
+ log_aserror(_("MovieClip.getBounds(%s): invalid call, first arg must be
a character"),
fn.arg(0));
);
return as_value();
=== modified file 'testsuite/actionscript.all/TextField.as'
--- a/testsuite/actionscript.all/TextField.as 2008-08-18 23:53:04 +0000
+++ b/testsuite/actionscript.all/TextField.as 2008-09-15 09:59:50 +0000
@@ -23,6 +23,18 @@
rcsid="$Id: TextField.as,v 1.56 2008/06/05 03:26:32 zoulunkai Exp $";
#include "check.as"
+printBounds = function(b)
+{
+ var s = '';
+ s += "xmin:"+b.xMin;
+ s += " ymin:"+b.yMin;
+ s += " xmax:"+b.xMax;
+ s += " ymax:"+b.yMax;
+ return s;
+};
+
+TextField.prototype.getBounds = MovieClip.prototype.getBounds;
+
#if OUTPUT_VERSION > 5
check_equals(typeof(TextField), 'function');
@@ -679,6 +691,21 @@
check_equals(tf._width, 500); // as it was set by createTextField, see above
tf._width = 99999;
check_equals(tf._width, 99999);
+b = tf.getBounds(_root); bs = printBounds(b);
+check_equals(bs, 'xmin:10 ymin:10 xmax:100009 ymax:510');
+tf.autoSize = false;
+tf.text = 'small'; // doesn't reset bounds (being autoSize false);
+check_equals(tf._width, 99999);
+b = tf.getBounds(_root); bs = printBounds(b);
+check_equals(bs, 'xmin:10 ymin:10 xmax:100009 ymax:510');
+
+tf.autoSize = true; // changes width !!
+check(tf._width < 99999);
+ow = tf._width;
+
+tf.autoSize = false; // doesn't reset to last manually set one
+check_equals(tf._width, ow);
+
tf._width = 500;
//-------------------------------------------------------------------------
@@ -896,9 +923,9 @@
//------------------------------------------------------------
#if OUTPUT_VERSION < 8
- check_totals(415);
+ check_totals(420);
#else
- check_totals(416);
+ check_totals(421);
#endif
#else // OUTPUT_VERSION <= 5
=== modified file 'testsuite/misc-ming.all/SharedObjectTestRunner.sh'
--- a/testsuite/misc-ming.all/SharedObjectTestRunner.sh 2008-09-12 07:21:19
+0000
+++ b/testsuite/misc-ming.all/SharedObjectTestRunner.sh 2008-09-15 10:53:00
+0000
@@ -56,7 +56,7 @@
cp -v ${INPUTSOLDIR}/*.sol ${SOLDIR}/
touch ${SOLDIR}/copytime
echo "SWF=${SWFTEST}"
-echo "INPUT=${SOLDIR}"
+echo "INPUT=${INPUTSOLDIR}"
echo "SOLDIR=${SOLDIR}"
sleep 1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9742: - Allow MovieClip.getBounds to be called for any character and with,
Sandro Santilli <=