/[gzz]/gzz/test/gzz/view/cellvobfactory.test
ViewVC logotype

Diff of /gzz/test/gzz/view/cellvobfactory.test

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by tjl, Tue Oct 15 17:42:19 2002 UTC revision 1.3 by tjl, Wed Oct 16 07:46:39 2002 UTC
# Line 39  class VC(ViewContext): Line 39  class VC(ViewContext):
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)
# Line 55  def testSingle__failing_solidbgvob(): Line 55  def testSingle__failing_solidbgvob():
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()
# Line 65  def testSingle__failing_solidbgvob(): Line 66  def testSingle__failing_solidbgvob():
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 :

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26