Esempio n. 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)
Esempio n. 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)
Esempio n. 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")
Esempio n. 4
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")
 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))
Esempio n. 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))