Integer is needed, not float

* The size of the image can only be integer, not float.
  Using round to convert it back
This commit is contained in:
Christoph Heuel 2015-06-04 13:20:17 +02:00
parent b99c076bae
commit 7da2e32e3c
1 changed files with 2 additions and 2 deletions

View File

@ -29,9 +29,9 @@ class Escpos:
else: else:
image_border = 32 - (size % 32) image_border = 32 - (size % 32)
if (image_border % 2) == 0: if (image_border % 2) == 0:
return (image_border / 2, image_border / 2) return (round(image_border / 2), round(image_border / 2))
else: else:
return (image_border / 2, (image_border / 2) + 1) return (round(image_border / 2), round((image_border / 2) + 1))
def _print_image(self, line, size): def _print_image(self, line, size):