[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/test/gzz/gfx/gl glvobcoorder.test
From: |
Asko Soukka |
Subject: |
[Gzz-commits] gzz/test/gzz/gfx/gl glvobcoorder.test |
Date: |
Wed, 20 Nov 2002 10:07:51 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Asko Soukka <address@hidden> 02/11/20 10:07:50
Modified files:
test/gzz/gfx/gl: glvobcoorder.test
Log message:
added tests for drawing textvob with different coordinate sstems
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/test/gzz/gfx/gl/glvobcoorder.test.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
Patches:
Index: gzz/test/gzz/gfx/gl/glvobcoorder.test
diff -u gzz/test/gzz/gfx/gl/glvobcoorder.test:1.23
gzz/test/gzz/gfx/gl/glvobcoorder.test:1.24
--- gzz/test/gzz/gfx/gl/glvobcoorder.test:1.23 Mon Nov 18 10:27:55 2002
+++ gzz/test/gzz/gfx/gl/glvobcoorder.test Wed Nov 20 10:07:49 2002
@@ -273,4 +273,37 @@
putThings()
checkAvgColor(10, 10, 80, 80, (255, 0, 0), delta=50)
+def testTextVob():
+ from gzz.client import GraphicsAPI
+ from java.awt import Font
+ style = GraphicsAPI.getInstance().getTextStyle("SansSerif", Font.PLAIN, 10)
+
+ size = vs.getSize()
+ def putThings():
+ vs.map.clear()
+ vs.map.put(gzz.vob.vobs.SolidBgVob(Color.red))
+ vs.map.put(textvob, cs_text)
+ render(vs)
+ textvob = gzz.vob.vobs.TextVob(style, "[XXXXX]")
+ text_size = 50
+ text_scale = style.getScaleByHeight(text_size)
+ text_width = int(textvob.getWidth(text_scale))
+ text_height = int(textvob.getHeight(text_scale))
+
+ cs = c.orthoBox(0, 0, 100, 100, 1, 1, size.width, size.height)
+ cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size)
+ putThings()
+ checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0),
delta=5)
+
+ cs = c.ortho(0, 0, 100, 100, size.width, size.height)
+ cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size)
+ putThings()
+ checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0),
delta=5)
+
+ cs = c.affineCoordsys(0, 0, 100, 100, size.width, 0, 0, size.height)
+ cs_text = c.ortho(cs, 0, 0, 0, text_size, text_size)
+ putThings()
+# checkNotAvgColor(100, 100, 100+text_width, 100+text_height, (255, 0, 0),
delta=5)
+
+
# : vim: set syntax=python :