39 |
bgc = (0, 0, 255) |
bgc = (0, 0, 255) |
40 |
|
|
41 |
def checkbox(x, y, w, h, color): |
def checkbox(x, y, w, h, color): |
42 |
# Check that edges are background-colored |
# Check that there is background-color behind the edges |
43 |
checkAvgColor(x-2, y-2, w+20, 1, bgc) |
checkAvgColor(x-3, y-3, w+20, 1, bgc) |
44 |
checkAvgColor(x-2, y-2, 1, h+20, bgc) |
checkAvgColor(x-3, y-3, 1, h+20, bgc) |
45 |
checkAvgColor(x-2, y+h+1, w+20, 1, bgc) |
checkAvgColor(x-3, y+h+2, w+20, 1, bgc) |
46 |
checkAvgColor(x+w+1, y-2, 1, h+20, bgc) |
checkAvgColor(x+w+2, y-3, 1, h+20, bgc) |
47 |
|
|
48 |
# Check that center is of given color |
# Check that center is of given color |
49 |
checkAvgColor(x+3, y+3, w-6, h-6, color) |
checkAvgColor(x+3, y+3, w-6, h-6, color) |
55 |
vs.map.put(SolidBgVob(Color.blue)) |
vs.map.put(SolidBgVob(Color.blue)) |
56 |
|
|
57 |
box = Box() |
box = Box() |
58 |
box.set(vs, vs.orthoCS(0, "A", 0, 100, 100, 1, 1), 200, 50) |
orth = vs.orthoCS(0, "A", 0, 100, 100, 1, 1) |
59 |
|
box.set(vs, orth, 200, 50) |
60 |
|
|
61 |
cvf = CellVobFactory() |
cvf = CellVobFactory() |
62 |
context = VC() |
context = VC() |
66 |
|
|
67 |
checkbox(100, 100, 200, 50, (255,255,255)) |
checkbox(100, 100, 200, 50, (255,255,255)) |
68 |
|
|
69 |
|
# Check that setting the coordsys params works |
70 |
|
vs.coords.setOrthoParams(orth, 0, 150, 200, .5, .5) |
71 |
|
render(vs) |
72 |
|
checkbox(150, 200, 100, 25, (255, 255, 255)) |
73 |
|
|
74 |
|
# Next, check that hierarchical coordinate systems work |
75 |
|
vs = getvs() |
76 |
|
vs.map.put(SolidBgVob(Color.blue)) |
77 |
|
parent = vs.orthoCS(0, "A", 0, 120, 60, 2, 2) |
78 |
|
child = vs.orthoCS(parent, "B", 0, 20, 30, .25, .25) |
79 |
|
box.set(vs, child, 200, 50) |
80 |
|
cvf.place(cell, vs, box, context) |
81 |
|
render(vs) |
82 |
|
checkbox(160, 120, 100, 25, (255, 255, 255)) |
83 |
|
|
84 |
# : vim: set syntax=python : |
# : vim: set syntax=python : |