et value of "ph" to 0 if division by zero takes place
This commit is contained in:
parent
e3b61a0ee0
commit
3ceb14f884
@ -971,14 +971,18 @@ class Invoker(GObject.GObject):
|
|||||||
|
|
||||||
ih = 0
|
ih = 0
|
||||||
|
|
||||||
# Set palette_halign to align to screen on left
|
if palette_dim.width == 0:
|
||||||
if dleft > dright:
|
ph = 0
|
||||||
ph = -float(dleft) / palette_dim.width
|
|
||||||
|
|
||||||
# Set palette_halign to align to screen on right
|
|
||||||
else:
|
else:
|
||||||
ph = -float(palette_dim.width - dright - rect.width) \
|
# Set palette_halign to align to screen on left
|
||||||
/ palette_dim.width
|
if dleft > dright:
|
||||||
|
ph = -float(dleft) / palette_dim.width
|
||||||
|
|
||||||
|
# Set palette_halign to align to screen on right
|
||||||
|
else:
|
||||||
|
ph = -float(palette_dim.width - dright - rect.width) \
|
||||||
|
/ palette_dim.width
|
||||||
|
|
||||||
return (ph, pv, ih, iv)
|
return (ph, pv, ih, iv)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user