示例#1
0
 def test_snap_to_grid6(self):
     g = GuiElement((16,16),(32,32),(0,0),snap_to_grid=16)
     assert g.rect() == (16,16,32,32)
示例#2
0
 def test_snap_to_grid2(self):
     g = GuiElement((10,10),(16,16),(0,0),snap_to_grid=16)
     assert g.rect() == (0,0,16,16)
示例#3
0
 def test_snap_to_grid4(self):
     g = GuiElement((16,16),(20,20),(0,0),snap_to_grid=16)
     assert g.rect() == (16,16,16,16)
示例#4
0
 def test_is_in(self,x,y,w,h,i,j):
     g = GuiElement((x,y),(w,h),(0,0))
     if 0 <= i and i <= 1 and 0 <= j and j <= 1:
         assert g.is_in((x+i*w,y+j*h)) == True
     else:
         assert g.is_in((x+i*w,y+j*h)) == False