projects
/
flexagon-toolkit.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
33f6577
)
svgwrite_diagram: implement the clear() method
author
Antonio Ospite <ao2@ao2.it>
Tue, 26 Jun 2018 13:45:24 +0000
(15:45 +0200)
committer
Antonio Ospite <ao2@ao2.it>
Wed, 27 Jun 2018 13:16:47 +0000
(15:16 +0200)
src/diagram/svgwrite_diagram.py
patch
|
blob
|
history
diff --git
a/src/diagram/svgwrite_diagram.py
b/src/diagram/svgwrite_diagram.py
index
bf94541
..
b9e5a56
100755
(executable)
--- a/
src/diagram/svgwrite_diagram.py
+++ b/
src/diagram/svgwrite_diagram.py
@@
-82,6
+82,15
@@
class SvgwriteDiagram(Diagram):
self.svg = InkscapeDrawing(None, profile='full', size=(str(width) + "px", str(height) + "px"))
self.active_group = self.svg
self.svg = InkscapeDrawing(None, profile='full', size=(str(width) + "px", str(height) + "px"))
self.active_group = self.svg
+ def clear(self):
+ # Reset the SVG object
+ self.svg.elements = []
+ self.svg.add(self.svg.defs)
+
+ rect = self.svg.rect((0, 0), ('100%', '100%'))
+ self._fill(rect, self.background)
+ self.svg.add(rect)
+
def save_svg(self, filename):
self.svg.saveas(filename)
def save_svg(self, filename):
self.svg.saveas(filename)