108 |
failUnlessEqual(cs1, c.getCSAt(0, 150, 150, None)) |
failUnlessEqual(cs1, c.getCSAt(0, 150, 150, None)) |
109 |
|
|
110 |
def testActiveDepthWithTrans(): |
def testActiveDepthWithTrans(): |
111 |
|
# These codes should be equivalent! |
112 |
|
# if (GraphicsAPI.getInstance() instanceof GLAPI) { |
113 |
|
# int focusCtr = vs.translateCS(0, "FocusCenter", ctrX,ctrY); |
114 |
|
# frameCS = vs.orthoBoxCS(focusCtr, "FocusFrame", 200, |
115 |
|
# -width/2, -height/2, 1, 1, |
116 |
|
# width, height); |
117 |
|
# } else { |
118 |
|
# frameCS = vs.orthoBoxCS(0, "FocusFrame", 200, |
119 |
|
# ctrX - width/2, ctrY - height/2, 1, 1, |
120 |
|
# width, height); |
121 |
|
# } |
122 |
|
# but they are not as this test finds out |
123 |
s = vs.size |
s = vs.size |
124 |
|
|
125 |
cs1 = c.orthoBox(0, 100,0,0,1,1, s.width, s.height) |
# translate in the center |
126 |
vs.activate(cs1) |
cs1 = vs.translateCS(0, "trans_to_center", s.width/2, s.height/2) |
127 |
|
# make 1/4 box in the center |
128 |
cs2 = vs.translateCS(0, "trans_to_center", s.width/2, s.height/2) |
cs2 = vs.orthoBoxCS(cs1, "box",0, -s.width/4, -s.height/4, 1,1,s.width/2, s.height/2) |
129 |
cs3 = vs.orthoCS(cs2, "box",0, -s.width/4, -s.height/4, s.width/2, s.height/2) |
# activate box |
130 |
vs.activate(cs3) |
vs.activate(cs2) |
131 |
|
|
132 |
|
# find the box from the center. |
133 |
|
failUnlessEqual(cs2, c.getCSAt(0, s.width/2, s.height/2, None)) |
134 |
|
|
|
failUnlessEqual(cs3, c.getCSAt(0, s.width/2, s.height/2, None)) |
|
135 |
|
|
136 |
def testActivateParents(): |
def testActivateParents(): |
137 |
"""Test that parent relationship is used correctly. |
"""Test that parent relationship is used correctly. |