Do not break lines on empty callbacks
Boxes.cc() did move the coordinate system arround even if the callback is None. This breaks the continuity of the border. If there is callback the line is still broken.
This commit is contained in:
parent
33d11487de
commit
44b55029a0
|
@ -430,26 +430,23 @@ class Boxes:
|
||||||
"""
|
"""
|
||||||
if y is None:
|
if y is None:
|
||||||
y = self.burn
|
y = self.burn
|
||||||
|
|
||||||
|
if hasattr(callback, '__getitem__'):
|
||||||
|
try:
|
||||||
|
callback = callback[number]
|
||||||
|
number = None
|
||||||
|
except (KeyError, IndexError):
|
||||||
|
pass
|
||||||
|
|
||||||
|
if callback and callable(callback):
|
||||||
self.ctx.save()
|
self.ctx.save()
|
||||||
self.moveTo(x, y)
|
self.moveTo(x, y)
|
||||||
if callable(callback):
|
|
||||||
if number is None:
|
if number is None:
|
||||||
callback()
|
callback()
|
||||||
else:
|
else:
|
||||||
callback(number)
|
callback(number)
|
||||||
|
|
||||||
elif hasattr(callback, '__getitem__'):
|
|
||||||
try:
|
|
||||||
callback = callback[number]
|
|
||||||
if callable(callback):
|
|
||||||
callback()
|
|
||||||
except (KeyError, IndexError):
|
|
||||||
pass
|
|
||||||
except:
|
|
||||||
self.ctx.restore()
|
|
||||||
raise
|
|
||||||
|
|
||||||
self.ctx.restore()
|
self.ctx.restore()
|
||||||
|
self.ctx.move_to(0, 0)
|
||||||
|
|
||||||
def getEntry(self, param, idx):
|
def getEntry(self, param, idx):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue