mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Start addressing review comments
Explicit cast to float is superfluous, thanks to __future__.division
This commit is contained in:
parent
04c7a8aa4a
commit
7c02419eed
@ -2616,10 +2616,9 @@ class KOBOTOUCH(KOBO):
|
|||||||
|
|
||||||
# NOTE: Loosely based on Qt's QSize::scaled implementation
|
# NOTE: Loosely based on Qt's QSize::scaled implementation
|
||||||
if keep_cover_aspect:
|
if keep_cover_aspect:
|
||||||
# NOTE: Py3k wouldn't need explicit casts to return a float
|
|
||||||
# NOTE: Unlike Qt, we round to avoid accumulating errors,
|
# NOTE: Unlike Qt, we round to avoid accumulating errors,
|
||||||
# as ImageOps will then floor via fit_image
|
# as ImageOps will then floor via fit_image
|
||||||
aspect_ratio = library_size[0] / float(library_size[1])
|
aspect_ratio = library_size[0] / library_size[1]
|
||||||
rescaled_width = int(round(kobo_size[1] * aspect_ratio))
|
rescaled_width = int(round(kobo_size[1] * aspect_ratio))
|
||||||
|
|
||||||
if expand:
|
if expand:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user