50 |
|
|
51 |
checkNotAvgColor(140, 140, 20, 20, (255, 0, 0), delta=1) |
checkNotAvgColor(140, 140, 20, 20, (255, 0, 0), delta=1) |
52 |
|
|
53 |
|
def testSolidBgVob(): |
54 |
|
"""Tests that SolidBgVob is drawn with wanted color, and after |
55 |
|
that the default color is black. """ |
56 |
|
|
57 |
|
sty1 = win.getGraphicsAPI().getTextStyle("SansSerif", 0, 20) |
58 |
|
|
59 |
|
vs = getvs() |
60 |
|
size = vs.getSize() |
61 |
|
vs.map.put(gzz.vob.vobs.SolidBgVob(Color.black)) |
62 |
|
|
63 |
|
textvob = gzz.vob.vobs.TextVob(sty1, "XXXXXX") |
64 |
|
|
65 |
|
text_width = int(textvob.getWidth(1)) |
66 |
|
text_height = int(textvob.getHeight(1)) |
67 |
|
text_depth = int(textvob.getDepth(1)) |
68 |
|
|
69 |
|
cs = vs.orthoBoxCS(0, "window", 0, 100, 100, 1, 1, size.width, size.height) |
70 |
|
cs_text = vs.orthoCS(cs, "text", 0, 0, 0, text_height + text_depth, text_height + text_depth) |
71 |
|
vs.map.put(textvob, cs_text) |
72 |
|
render(vs) |
73 |
|
|
74 |
|
checkAvgColor(100, 100, text_width, text_height+text_depth, (0, 0, 0), delta=1) |
75 |
|
|
76 |
def testOvalbgVob(): |
def testOvalbgVob(): |
77 |
"""Tests that OvalBgVob is drawn correctly using box CS. |
"""Tests that OvalBgVob is drawn correctly using box CS. |
78 |
""" |
""" |