1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 20:37:35 +00:00

LibWeb: Perform rounding when dividing CSSPixels

This should allow us to produce results that more closely match old
layouts when divisions were done in floating-point.
This commit is contained in:
Zaggy1024 2023-09-03 19:03:03 -05:00 committed by Alexander Kalenik
parent bd85e1b30b
commit 98926b487c
27 changed files with 250 additions and 233 deletions

View file

@ -7,12 +7,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <div.item-left> at (8,8) content-size 100x35.40625 [BFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.item-right> at (108.03125,8) content-size 683.96875x35.40625 [BFC] children: inline
BlockContainer <div.item-right> at (108.015625,8) content-size 683.984375x35.40625 [BFC] children: inline
line 0 width: 625.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 77, rect: [108.03125,8 625.953125x17.46875]
frag 0 from TextNode start: 0, length: 77, rect: [108.015625,8 625.953125x17.46875]
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut iaculis venenatis"
line 1 width: 304.0625, height: 17.9375, bottom: 35.40625, baseline: 13.53125
frag 0 from TextNode start: 78, length: 39, rect: [108.03125,25 304.0625x17.46875]
frag 0 from TextNode start: 78, length: 39, rect: [108.015625,25 304.0625x17.46875]
"purus, eget blandit velit venenatis at."
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -25,6 +25,6 @@ ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x35.40625]
PaintableBox (Box<DIV>.container) [8,8 784x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-left) [8,8 100x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-right) [108.03125,8 683.96875x35.40625]
PaintableWithLines (BlockContainer<DIV>.item-right) [108.015625,8 683.984375x35.40625]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,43.40625 784x0]