Add debug rectangle for move commands
This commit is contained in:
parent
1cf671ddd2
commit
c45b5cd30b
|
@ -973,15 +973,17 @@ class Boxes:
|
||||||
for term in terms:
|
for term in terms:
|
||||||
if not term in moves:
|
if not term in moves:
|
||||||
raise ValueError("Unknown direction: '%s'" % term)
|
raise ValueError("Unknown direction: '%s'" % term)
|
||||||
x, y, movebeforeprint = moves[term]
|
mx, my, movebeforeprint = moves[term]
|
||||||
if movebeforeprint and before:
|
if movebeforeprint and before:
|
||||||
self.moveTo(x, y)
|
self.moveTo(mx, my)
|
||||||
elif (not movebeforeprint and not before) or dontdraw:
|
elif (not movebeforeprint and not before) or dontdraw:
|
||||||
self.moveTo(x, y)
|
self.moveTo(mx, my)
|
||||||
if not dontdraw:
|
if not dontdraw:
|
||||||
if before:
|
if before:
|
||||||
# save position
|
# save position
|
||||||
self.ctx.save()
|
self.ctx.save()
|
||||||
|
if self.debug:
|
||||||
|
self.ctx.rectangle(0, 0, x, y)
|
||||||
self.moveTo(self.spacing / 2.0, self.spacing / 2.0)
|
self.moveTo(self.spacing / 2.0, self.spacing / 2.0)
|
||||||
return dontdraw
|
return dontdraw
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue