コード例 #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])
コード例 #2
0
ファイル: presentation.py プロジェクト: tuxcell/gaphor
 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)
コード例 #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]
コード例 #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]