Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a transform breaks subpixel positionning #7904

Closed
paulrouget opened this issue Oct 7, 2015 · 1 comment
Closed

Using a transform breaks subpixel positionning #7904

paulrouget opened this issue Oct 7, 2015 · 1 comment

Comments

@paulrouget
Copy link
Contributor

If an element has a transform (transform:scale(1) for example), its coordinates are rounded (top:11.5px becomes top:12px).

<div id='d1'></div>
<div id='d2'></div>

<style>
  div {
    position: absolute;
    top: 11.5px;
    width: 100px;
    height: 100px;
  }

  #d1 {
    left: 100px;
    background: green;
  }

  #d2 {
    left: 200px;
    background: red;
    transform: scale(1);
  }

</style>

Note the green div is a bit higher than the red div:

screen shot 2015-10-07 at 12 53 11

@paulrouget
Copy link
Contributor Author

I have a fix coming up.

bors-servo pushed a commit that referenced this issue Oct 8, 2015
Snap to screen pixels instead of px

Fixes #7904

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7909)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Oct 9, 2015
Snap to screen pixels instead of px

Fixes #7904

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7909)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants