Skip to content

Commit

Permalink
Merge 456c193 into 67748f8
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Dec 5, 2014
2 parents 67748f8 + 456c193 commit 8873819
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mgp2pdf.py
Expand Up @@ -464,6 +464,7 @@ class Mark(SimpleChunk):

def __init__(self):
self.pos = None
self.used = False

def drawOn(self, canvas, x, y, w, h):
self.pos = x, y
Expand All @@ -481,7 +482,11 @@ def __init__(self, mark):

def drawOn(self, canvas, x, y, w, h):
assert self.mark.pos is not None, "Mark not initialized yet!"
if self.mark.used:
# a mark can be used only once
return x, y
mx, my = self.mark.pos
self.mark.used = True
return x, my

def __str__(self):
Expand Down

0 comments on commit 8873819

Please sign in to comment.