Bug 195401 - Transform scale() combined with a devicePixelRatio creates roundoff errors
Summary: Transform scale() combined with a devicePixelRatio creates roundoff errors
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 12
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-03-06 23:35 PST by Tom Dezentje
Modified: 2019-03-07 15:36 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Dezentje 2019-03-06 23:35:56 PST
When a browser has a devicePixelRatio with decimals there seems to be a roundoff error.
As shown in the following example: https://jsfiddle.net/xb813adh

The red bar is always 100px and scales accordingly.
The blue bar is 1px width scaled with a transform. It should always be the same width as the red bar.

When zooming in the width of the blue bar stays the same for 1, 1.10 and 1.25. 
After that it stays the same until a scale of 2.

Changing the example to scale 50px 2 times gives minor roundoff errors but is still incorrect.
Seen here: https://jsfiddle.net/y9jg10hp/

Other browsers show the correct working.
Comment 1 Radar WebKit Bug Importer 2019-03-06 23:36:48 PST
<rdar://problem/48667104>