示例#1
0
 def test_rotate_ctm(self):
     angle = pi/4.
     path = agg.CompiledPath()
     path.rotate_ctm(angle)
     actual = path.get_ctm()
     desired = agg.rotation_matrix(angle)
     self.assertRavelEqual(actual, desired)
示例#2
0
 def test_rotate_ctm(self):
     angle = pi / 4.
     path = agg.CompiledPath()
     path.rotate_ctm(angle)
     actual = path.get_ctm()
     desired = agg.rotation_matrix(angle)
     self.assertRavelEqual(actual, desired)
示例#3
0
def test_handling_text(gc):
    font = Font(face_name="Arial", size=32)
    gc.set_font(font)
    gc.translate_ctm(100.0, 100.0)
    gc.move_to(-5, 0)
    gc.line_to(5, 0)
    gc.move_to(0, 5)
    gc.line_to(0, -5)
    gc.move_to(0, 0)
    gc.stroke_path()
    txtRot = agg.rotation_matrix(PI / 6)
    gc.set_text_matrix(txtRot)
    gc.show_text("Hello")
    txtRot.invert()
    gc.set_text_matrix(txtRot)

    gc.show_text("inverted")
示例#4
0
文件: dummy.py 项目: GaZ3ll3/enable
def test_handling_text(gc):
    font = Font(face_name="Arial", size = 32)
    gc.set_font(font)
    gc.translate_ctm(100.0, 100.0)
    gc.move_to(-5,0)
    gc.line_to(5,0)
    gc.move_to(0,5)
    gc.line_to(0,-5)
    gc.move_to(0,0)
    gc.stroke_path()
    txtRot = agg.rotation_matrix(PI/6)
    gc.set_text_matrix(txtRot)
    gc.show_text("Hello")
    txtRot.invert()
    gc.set_text_matrix(txtRot)

    gc.show_text("inverted")
 def test_rotate_ctm(self):
     gc = agg.GraphicsContextArray((100,100))
     gc.rotate_ctm(pi/4.)
     actual = gc.get_ctm()
     desired = agg.rotation_matrix(pi/4.)
     self.assertEqual(actual, tuple(desired))
示例#6
0
 def test_rotate_ctm(self):
     gc = agg.GraphicsContextArray((100, 100))
     gc.rotate_ctm(pi / 4.0)
     actual = gc.get_ctm()
     desired = agg.rotation_matrix(pi / 4.0)
     self.assertEqual(actual, tuple(desired))
 def test_rotation_matrix(self):
     val = agg.rotation_matrix(pi / 2.)
     desired = array([0.0, 1.0, -1.0, 0.0, 0.0, 0.0])
     actual = val.asarray()
     assert (allclose(desired, actual))
 def test_rotation_matrix(self):
     val = agg.rotation_matrix(pi/2.)
     desired = array([ 0.0,1.0,-1.0,0.0,0.0,0.0])
     actual = val.asarray()
     assert(allclose(desired,actual))