Skip to content

Using a transform breaks subpixel positionning #7904

Closed

Description

@paulrouget

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

Activity

  1. paulrouget commented on Oct 7, 2015

    @paulrouget
    ContributorAuthor

    I have a fix coming up.

  2. added 2 commits that reference this issue on Oct 8, 2015
    f7b2c3e
    8ef8c53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions