本文整理汇总了Python中gaphas.item.Line.merge_segment方法的典型用法代码示例。如果您正苦于以下问题:Python Line.merge_segment方法的具体用法?Python Line.merge_segment怎么用?Python Line.merge_segment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaphas.item.Line
的用法示例。
在下文中一共展示了Line.merge_segment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_orthogonal_line_split_segment
# 需要导入模块: from gaphas.item import Line [as 别名]
# 或者: from gaphas.item.Line import merge_segment [as 别名]
def test_orthogonal_line_split_segment(self):
canvas = Canvas()
line = Line()
canvas.add(line)
assert len(canvas.solver._constraints) == 0
line.orthogonal = True
assert len(canvas.solver._constraints) == 2
after_ortho = set(canvas.solver._constraints)
assert len(line.handles()) == 3
del undo_list[:]
line.split_segment(0)
assert len(canvas.solver._constraints) == 3
assert len(line.handles()) == 4
undo()
assert len(canvas.solver._constraints) == 2
assert len(line.handles()) == 3
assert canvas.solver._constraints == after_ortho
line.split_segment(0)
assert len(canvas.solver._constraints) == 3
assert len(line.handles()) == 4
after_split = set(canvas.solver._constraints)
del undo_list[:]
line.merge_segment(0)
assert len(canvas.solver._constraints) == 2
assert len(line.handles()) == 3
undo()
assert len(canvas.solver._constraints) == 3
assert len(line.handles()) == 4
assert canvas.solver._constraints == after_split