[Webkit-unassigned] [Bug 78040] New: Add pixelSnappedX/Y/Width/Height methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 7 14:16:53 PST 2012


           Summary: Add pixelSnappedX/Y/Width/Height methods
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eae at chromium.org
                CC: eric at webkit.org, hyatt at apple.com, darin at apple.com,
                    leviw at chromium.org
            Blocks: 60318

Add pixel snapped versions of x/y/width/height methods. These return the same value as the x/w/width/height methods for now but once we move over to sub pixel layout they will snap the subpixel value to a device pixel and return an integer value.

When snapping the left and top edge is simply rounded to the nearest device pixel.
The right and bottom edges are computed by subtracting the rounded left/top edge from the precise location and size. This ensures that the edges all line up with device pixels and that the total size of an object, including borders, is at most one pixel off.

x: round(x)
y: round(y)
maxX: round(x + width) - round(x)
maxY: round(y + height) - round(y)

We use the term pixel snapped to indicate that the numbers are not merely rounded. Aligned might have been a better name but the term is already quite overloaded.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list