2
# Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com)
4
# Jockey is free software; you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License as published by the
6
# Free Software Foundation; either version 2, or (at your option) any
9
# Jockey is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18
def _draw_zap(can, p1, p2, style, pat):
21
can.polygon(None, pat, x)
26
def zap_horizontally(can, style, pat, x1, y1, x2, y2, xsize, ysize):
27
"""Draw a horizontal "zapping" symbol on the canvas that shows
28
that a graph is ripped in the middle.
30
Parameter <fill_style> specifies the style for the zig-zag lines.
31
PAT specifies the pattern with which the area is filled.
32
The symbol is drawn in the rectangle (<x1>, <y1>) - (<x2>, <y2>).
33
Each "zigzag" has the width <xsize>, height <ysize>."""
35
assert isinstance(style, line_style.T)
36
assert isinstance(pat, fill_style.T)
44
points2.append((x, y + (y2-y1)))
52
_draw_zap(can, points, points2, style, pat)
54
def zap_vertically(can, style, pat, x1, y1, x2, y2, xsize, ysize):
55
"""Draw a vertical "zapping" symbol on the canvas that shows
56
that a graph is ripped in the middle.
58
Parameter <fill_style> specifies the style for the zig-zag lines.
59
PAT specifies the pattern with which the area is filled.
60
The symbol is drawn in the rectangle (<x1>, <y1>) - (<x2>, <y2>).
61
Each "zigzag" has the width <xsize>, height <ysize>."""
69
points2.append((x + (x2-x1), y))
77
_draw_zap(can, points, points2, style, pat)