Gecko:Image Snapping and Rendering: Difference between revisions

Jump to navigation Jump to search
Line 29: Line 29:
# The ratio of initial rectangle size in device pixels to image size in CSS pixels, along both axes, must be used as the scale factors for the image space to device space transform. (RATIONALE: Otherwise scaled image tiling will become grossly incorrect at large distances.)
# The ratio of initial rectangle size in device pixels to image size in CSS pixels, along both axes, must be used as the scale factors for the image space to device space transform. (RATIONALE: Otherwise scaled image tiling will become grossly incorrect at large distances.)
# The anchor point, mapped back to image space via the initial rect, and then mapped to device space via the algorithm's image space to device space transform, then snapped to the nearest device pixel, should end up at the original anchor point transformed by the logical-fill-rectangle-to-device-fill-rectangle transform and then snapped to the nearest device pixel. (RATIONALE: A CSS background-position:right/bottom image should actually be drawn with the rightmost/bottommost set of pixels at the appropriate edge of the element, no matter what scaling is in effect, so we need to be told which edges should line up and make sure they do.)
# The anchor point, mapped back to image space via the initial rect, and then mapped to device space via the algorithm's image space to device space transform, then snapped to the nearest device pixel, should end up at the original anchor point transformed by the logical-fill-rectangle-to-device-fill-rectangle transform and then snapped to the nearest device pixel. (RATIONALE: A CSS background-position:right/bottom image should actually be drawn with the rightmost/bottommost set of pixels at the appropriate edge of the element, no matter what scaling is in effect, so we need to be told which edges should line up and make sure they do.)
# The device fill rectangle, mapped back to image space, must intersect the subimage rectangle.
(RATIONALE: If they don't intersect then it's not clear what should be rendered.)


Requirements 5 and 6 imply the following additional requirement:
Requirements 5 and 6 imply the following additional requirement:
1,295

edits

Navigation menu