Skip to content

Commit

Permalink
Revert "use floor in cm_to_px instead of round"
Browse files Browse the repository at this point in the history
This reverts commit 7e65d91.
  • Loading branch information
thiagowfx committed Jun 14, 2023
1 parent d2f73a9 commit f00a6e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions webdriver/tests/support/fixtures_bidi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from math import floor
import base64

from tests.support.image import cm_to_px, png_dimensions, ImageDifference
Expand Down Expand Up @@ -208,8 +207,8 @@ async def assert_pdf_dimensions(pdf, expected_dimensions):
png = await render_pdf_to_png_bidi(pdf)
width, height = png_dimensions(png)

assert floor(cm_to_px(expected_dimensions["height"])) == height
assert floor(cm_to_px(expected_dimensions["width"])) == width
assert (height - 1) <= cm_to_px(expected_dimensions["height"]) <= (height + 1)
assert (width - 1) <= cm_to_px(expected_dimensions["width"]) <= (width + 1)

return assert_pdf_dimensions

Expand Down
2 changes: 1 addition & 1 deletion webdriver/tests/support/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def cm_to_px(cm):
return cm * PPI / inch_in_cm
return round(cm * PPI / inch_in_cm)


def px_to_cm(px):
Expand Down

1 comment on commit f00a6e1

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: Invalid request.

Only 65535 characters are allowed; 2477746 were supplied.

Please sign in to comment.