Ejemplo n.º 1
0
def test_point_at_center_bottom(points, point_at_line):
    """
    Test aligned at the line text position calculation, horizontal mode
    """
    x, y = text_point_at_line(points, (10, 5), TextAlign.CENTER)

    assert x == pytest.approx(point_at_line[0])
    assert y == pytest.approx(point_at_line[1])
Ejemplo n.º 2
0
 def shape_bounds(shape, align):
     if shape:
         size = shape.size(context)
         x, y = text_point_at_line(points, size, align)
         return Rectangle(x, y, *size)
Ejemplo n.º 3
0
def test_point_at_right_top(points, point_at_line):
    x, y = text_point_at_line(points, (10, 5), TextAlign.RIGHT)

    assert x == point_at_line[0]
    assert y == point_at_line[1]
Ejemplo n.º 4
0
def test_point_at_left_top(points, point_at_line):
    x, y = text_point_at_line(points, (10, 5), TextAlign.LEFT)

    assert x == point_at_line[0]
    assert y == point_at_line[1]