[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Drawing...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/Drawing... |
Date: |
Tue, 24 Apr 2007 11:55:33 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/04/24 11:55:33
Modified files:
. : ChangeLog
testsuite/misc-ming.all: DrawingApiTest.as
DrawingApiTestRunner.cpp
Log message:
* testsuite/misc-ming.all/: DrawingApiTest.as,
DrawingApiTestRunner.cpp: Add a circle drawing and
test for collision detection of curved fills.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2981&r2=1.2982
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DrawingApiTest.as?cvsroot=gnash&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp?cvsroot=gnash&r1=1.10&r2=1.11
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.2981
retrieving revision 1.2982
diff -u -b -r1.2981 -r1.2982
--- ChangeLog 24 Apr 2007 10:01:46 -0000 1.2981
+++ ChangeLog 24 Apr 2007 11:55:32 -0000 1.2982
@@ -1,5 +1,11 @@
2007-04-24 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/: DrawingApiTest.as,
+ DrawingApiTestRunner.cpp: Add a circle drawing and
+ test for collision detection of curved fills.
+
+2007-04-24 Sandro Santilli <address@hidden>
+
* server/shape.{cpp,h} (point_test): only check for the
"interior" of the shape, forget its boundaries.
* testsuite/misc-ming.all/DrawingApiTestRunner.cpp: one
Index: testsuite/misc-ming.all/DrawingApiTest.as
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/DrawingApiTest.as,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- testsuite/misc-ming.all/DrawingApiTest.as 24 Apr 2007 09:07:32 -0000
1.8
+++ testsuite/misc-ming.all/DrawingApiTest.as 24 Apr 2007 11:55:33 -0000
1.9
@@ -22,6 +22,29 @@
halftransparent = new Object();
halftransparent.valueOf = function() { return 50; };
+// Draw a circle with given center and radius
+// Uses 8 curves to approximate the circle
+drawCircle = function (where, x, y, rad)
+{
+ var ctl = Math.sin(24*Math.PI/180)*rad;
+ var cos = Math.cos(45*Math.PI/180)*rad;
+ var sin = Math.sin(45*Math.PI/180)*rad;
+
+ with (where)
+ {
+ moveTo(x, y-rad);
+ curveTo(x+ctl, y-rad, x+cos, y-sin);
+ curveTo(x+rad, y-ctl, x+rad, y);
+ curveTo(x+rad, y+ctl, x+cos, y+sin);
+ curveTo(x+ctl, y+rad, x, y+rad);
+ curveTo(x-ctl, y+rad, x-cos, y+sin);
+ curveTo(x-rad, y+ctl, x-rad, y);
+ curveTo(x-rad, y-ctl, x-cos, y-sin);
+ curveTo(x-ctl, y-rad, x, y-rad);
+ }
+};
+
+
with (a)
{
clear();
@@ -97,6 +120,11 @@
lineTo(240, 100);
lineTo(260, 100);
endFill();
+
+ // The green circle
+ lineStyle(8, 0x000000);
+ beginFill(0x00FF00, 100);
+ drawCircle(a, 330, 160, 35);
}
// Make the MovieClip "active" (grabbing mouse events)
Index: testsuite/misc-ming.all/DrawingApiTestRunner.cpp
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/DrawingApiTestRunner.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- testsuite/misc-ming.all/DrawingApiTestRunner.cpp 24 Apr 2007 10:01:47
-0000 1.10
+++ testsuite/misc-ming.all/DrawingApiTestRunner.cpp 24 Apr 2007 11:55:33
-0000 1.11
@@ -70,6 +70,13 @@
check(tester.isMouseOverMouseEntity());
check_pixel(60, 215, 2, blue, 1);
+ // Inside bottom-left blue fill but in the
+ // curve internal to check if the point_test
+ // works for filled curves
+ tester.movePointerTo(40, 205);
+ check(tester.isMouseOverMouseEntity());
+ check_pixel(40, 205, 2, blue, 1);
+
// Inside cyan clockwise fill
tester.movePointerTo(190, 112);
check(tester.isMouseOverMouseEntity());
@@ -117,12 +124,23 @@
// In the middle of an imaginary line between
// first and last point of the green curve
- tester.movePointerTo(355, 156);
+ tester.movePointerTo(376, 180);
xcheck(!tester.isMouseOverMouseEntity()); // fails due to
edge::withinSquareDistance bug
- check_pixel(355, 156, 2, white, 2);
+ check_pixel(376, 180, 2, white, 2);
+ // Over the green curve
tester.movePointerTo(376, 139);
xcheck(tester.isMouseOverMouseEntity()); // fails due to
edge::withinSquareDistance bug
check_pixel(376, 139, 2, green, 2); // fails due to bug in AGG
+
+ // Over the center of the green circle fill
+ tester.movePointerTo(330, 160);
+ check(tester.isMouseOverMouseEntity());
+ check_pixel(330, 160, 2, green, 2);
+
+ // Over the boundary of the green circle fill
+ tester.movePointerTo(363, 174);
+ xcheck(tester.isMouseOverMouseEntity()); // fails due to
edge::withinSquareDistance bug
+ check_pixel(363, 174, 2, black, 2);
}