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