1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:47:35 +00:00

AK+LibWeb: Round to int in clamp_to_int instead of truncating

This caused inaccuracies in float->CssPixel conversions
This commit is contained in:
Hendiadyoin1 2023-07-29 15:30:57 +02:00 committed by Alexander Kalenik
parent 7b7ba38655
commit af161a8b83
58 changed files with 693 additions and 692 deletions

View file

@ -103,9 +103,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
Box <div.grid-container> at (8,275.34375) content-size 784x90.9375 [GFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.grid-item> at (444.1875,285.34375) content-size 337.796875x17.46875 [BFC] children: inline
BlockContainer <div.grid-item> at (444.203125,285.34375) content-size 337.796875x17.46875 [BFC] children: inline
line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [444.1875,285.34375 6.34375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [444.203125,285.34375 6.34375x17.46875]
"1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -197,7 +197,7 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,275.34375 784x0]
PaintableBox (Box<DIV>.grid-container) [8,275.34375 784x90.9375]
PaintableWithLines (BlockContainer<DIV>.grid-item) [434.1875,275.34375 357.796875x37.46875]
PaintableWithLines (BlockContainer<DIV>.grid-item) [434.203125,275.34375 357.796875x37.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.grid-item) [8,328.8125 357.796875x37.46875]
TextPaintable (TextNode<#text>)

View file

@ -2,9 +2,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x50.9375 children: not-inline
Box <div.container> at (8,8) content-size 784x50.9375 [GFC] children: not-inline
BlockContainer <div.item> at (434.1875,8) content-size 357.796875x17.46875 [BFC] children: inline
BlockContainer <div.item> at (434.203125,8) content-size 357.796875x17.46875 [BFC] children: inline
line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 1, rect: [434.1875,8 6.34375x17.46875]
frag 0 from TextNode start: 0, length: 1, rect: [434.203125,8 6.34375x17.46875]
"1"
TextNode <#text>
BlockContainer <div.item> at (8,41.46875) content-size 357.796875x17.46875 [BFC] children: inline
@ -17,7 +17,7 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x50.9375]
PaintableBox (Box<DIV>.container) [8,8 784x50.9375]
PaintableWithLines (BlockContainer<DIV>.item) [434.1875,8 357.796875x17.46875]
PaintableWithLines (BlockContainer<DIV>.item) [434.203125,8 357.796875x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.item) [8,41.46875 357.796875x17.46875]
TextPaintable (TextNode<#text>)

View file

@ -5,29 +5,29 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.grid-item> at (68,68) content-size 17.046875x32.75 [BFC] children: inline
line 0 width: 11.890625, height: 32.75, bottom: 32.75, baseline: 25.359375
line 0 width: 11.890625, height: 32.75, bottom: 32.75, baseline: 25.375
frag 0 from TextNode start: 0, length: 1, rect: [70.578125,68 11.890625x32.75]
"1"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.grid-item> at (255.046875,68) content-size 16.515625x32.75 [BFC] children: inline
line 0 width: 16.515625, height: 32.75, bottom: 32.75, baseline: 25.359375
frag 0 from TextNode start: 0, length: 1, rect: [255.046875,68 16.515625x32.75]
BlockContainer <div.grid-item> at (255.046875,68) content-size 16.53125x32.75 [BFC] children: inline
line 0 width: 16.53125, height: 32.75, bottom: 32.75, baseline: 25.375
frag 0 from TextNode start: 0, length: 1, rect: [255.046875,68 16.53125x32.75]
"2"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.grid-item> at (68,270.75) content-size 17.046875x32.75 [BFC] children: inline
line 0 width: 17.046875, height: 32.75, bottom: 32.75, baseline: 25.359375
line 0 width: 17.046875, height: 32.75, bottom: 32.75, baseline: 25.375
frag 0 from TextNode start: 0, length: 1, rect: [68,270.75 17.046875x32.75]
"3"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.grid-item> at (255.046875,270.75) content-size 16.515625x32.75 [BFC] children: inline
line 0 width: 14.53125, height: 32.75, bottom: 32.75, baseline: 25.359375
frag 0 from TextNode start: 0, length: 1, rect: [256.03125,270.75 14.53125x32.75]
BlockContainer <div.grid-item> at (255.046875,270.75) content-size 16.53125x32.75 [BFC] children: inline
line 0 width: 14.53125, height: 32.75, bottom: 32.75, baseline: 25.375
frag 0 from TextNode start: 0, length: 1, rect: [256.046875,270.75 14.53125x32.75]
"4"
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
@ -41,10 +41,10 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableBox (Box<DIV>.grid-container) [8,8 784x355.5]
PaintableWithLines (BlockContainer<DIV>.grid-item) [8,8 137.046875x152.75]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.grid-item) [195.046875,8 136.515625x152.75]
PaintableWithLines (BlockContainer<DIV>.grid-item) [195.046875,8 136.53125x152.75]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.grid-item) [8,210.75 137.046875x152.75]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.grid-item) [195.046875,210.75 136.515625x152.75]
PaintableWithLines (BlockContainer<DIV>.grid-item) [195.046875,210.75 136.53125x152.75]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,363.5 784x0]

View file

@ -3,9 +3,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
BlockContainer <div> at (8,8) content-size 784x17.46875 children: not-inline
Box <div.grid> at (8,8) content-size 784x17.46875 [GFC] children: not-inline
BlockContainer <div.item> at (243.1875,8) content-size 313.625x17.46875 [BFC] children: inline
BlockContainer <div.item> at (243.203125,8) content-size 313.59375x17.46875 [BFC] children: inline
line 0 width: 121.0625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 16, rect: [243.1875,8 121.0625x17.46875]
frag 0 from TextNode start: 0, length: 16, rect: [243.203125,8 121.0625x17.46875]
"A filthy t-shirt"
TextNode <#text>

View file

@ -7,7 +7,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
frag 0 from TextNode start: 0, length: 5, rect: [8,8 42.140625x17.46875]
"First"
TextNode <#text>
BlockContainer <div.second> at (400,8) content-size 78.390625x17.46875 [BFC] children: inline
BlockContainer <div.second> at (400,8) content-size 78.40625x17.46875 [BFC] children: inline
line 0 width: 57.40625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 6, rect: [400,8 57.40625x17.46875]
"Second"
@ -19,5 +19,5 @@ PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableBox (Box<DIV>.grid-container) [8,8 784x17.46875]
PaintableWithLines (BlockContainer<DIV>.first) [8,8 313.59375x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.second) [400,8 78.390625x17.46875]
PaintableWithLines (BlockContainer<DIV>.second) [400,8 78.40625x17.46875]
TextPaintable (TextNode<#text>)

View file

@ -1,21 +1,21 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (1,1) content-size 798x65.640625 [BFC] children: not-inline
Box <body> at (10,10) content-size 780x47.640625 [GFC] children: not-inline
BlockContainer <html> at (1,1) content-size 798x65.65625 [BFC] children: not-inline
Box <body> at (10,10) content-size 780x47.65625 [GFC] children: not-inline
BlockContainer <div.foo> at (11,11) content-size 778x21.8125 [BFC] children: inline
line 0 width: 33.9375, height: 21.828125, bottom: 21.828125, baseline: 16.890625
frag 0 from TextNode start: 0, length: 3, rect: [11,11 33.9375x21.828125]
line 0 width: 33.9375, height: 21.84375, bottom: 21.84375, baseline: 16.921875
frag 0 from TextNode start: 0, length: 3, rect: [11,11 33.9375x21.84375]
"foo"
TextNode <#text>
BlockContainer <div.bar> at (11,34.8125) content-size 778x21.828125 [BFC] children: inline
line 0 width: 34.546875, height: 21.828125, bottom: 21.828125, baseline: 16.890625
frag 0 from TextNode start: 0, length: 3, rect: [11,34.8125 34.546875x21.828125]
BlockContainer <div.bar> at (11,34.8125) content-size 778x21.84375 [BFC] children: inline
line 0 width: 34.546875, height: 21.84375, bottom: 21.84375, baseline: 16.921875
frag 0 from TextNode start: 0, length: 3, rect: [11,34.8125 34.546875x21.84375]
"bar"
TextNode <#text>
PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x67.640625]
PaintableBox (Box<BODY>) [9,9 782x49.640625]
PaintableWithLines (BlockContainer<DIV>.foo) [10,10 780x23.8125] overflow: [11,11 778x21.828125]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x67.65625]
PaintableBox (Box<BODY>) [9,9 782x49.65625]
PaintableWithLines (BlockContainer<DIV>.foo) [10,10 780x23.8125] overflow: [11,11 778x21.84375]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.bar) [10,33.8125 780x23.84375]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<DIV>.bar) [10,33.8125 780x23.828125]
TextPaintable (TextNode<#text>)

View file

@ -1,21 +1,21 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x24 children: not-inline
Box <div.grid-container> at (8,8) content-size 784x24 [GFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x24.015625 children: not-inline
Box <div.grid-container> at (8,8) content-size 784x24.015625 [GFC] children: not-inline
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
BlockContainer <div.wrapper> at (8,8) content-size 64.015625x24 [BFC] children: inline
line 0 width: 64.015625, height: 24, bottom: 24, baseline: 24
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64.015625x24]
BlockContainer <div.wrapper> at (8,8) content-size 64.03125x24.015625 [BFC] children: inline
line 0 width: 64.03125, height: 24.015625, bottom: 24.015625, baseline: 24.015625
frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64.03125x24.015625]
TextNode <#text>
ImageBox <img> at (8,8) content-size 64.015625x24 children: not-inline
ImageBox <img> at (8,8) content-size 64.03125x24.015625 children: not-inline
TextNode <#text>
BlockContainer <(anonymous)> (not painted) [BFC] children: inline
TextNode <#text>
PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x24]
PaintableBox (Box<DIV>.grid-container) [8,8 784x24]
PaintableWithLines (BlockContainer<DIV>.wrapper) [8,8 64.015625x24]
ImagePaintable (ImageBox<IMG>) [8,8 64.015625x24]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x24.015625]
PaintableBox (Box<DIV>.grid-container) [8,8 784x24.015625]
PaintableWithLines (BlockContainer<DIV>.wrapper) [8,8 64.03125x24.015625]
ImagePaintable (ImageBox<IMG>) [8,8 64.03125x24.015625]

View file

@ -1,21 +1,18 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x34.9375 children: not-inline
Box <div.ipc-page-grid> at (8,8) content-size 784x34.9375 flex-container(row) [FFC] children: not-inline
Box <div.ipc-sub-grid> at (8,8) content-size 401.28125x34.9375 flex-item [GFC] children: not-inline
BlockContainer <(anonymous)> at (8,8) content-size 401.265625x34.9375 [BFC] children: inline
line 0 width: 356.96875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 40, rect: [8,8 356.96875x17.46875]
"The 10 Most Anticipated Summer Movies of"
line 1 width: 36.3125, height: 17.46875, bottom: 34.9375, baseline: 13.53125
frag 0 from TextNode start: 41, length: 4, rect: [8,25.46875 36.3125x17.46875]
"2023"
BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
Box <div.ipc-page-grid> at (8,8) content-size 784x17.46875 flex-container(row) [FFC] children: not-inline
Box <div.ipc-sub-grid> at (8,8) content-size 401.28125x17.46875 flex-item [GFC] children: not-inline
BlockContainer <(anonymous)> at (8,8) content-size 401.28125x17.46875 [BFC] children: inline
line 0 width: 401.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 45, rect: [8,8 401.28125x17.46875]
"The 10 Most Anticipated Summer Movies of 2023"
TextNode <#text>
PaintableWithLines (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x34.9375]
PaintableBox (Box<DIV>.ipc-page-grid) [8,8 784x34.9375]
PaintableBox (Box<DIV>.ipc-sub-grid) [8,8 401.28125x34.9375]
PaintableWithLines (BlockContainer(anonymous)) [8,8 401.265625x34.9375]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x17.46875]
PaintableBox (Box<DIV>.ipc-page-grid) [8,8 784x17.46875]
PaintableBox (Box<DIV>.ipc-sub-grid) [8,8 401.28125x17.46875]
PaintableWithLines (BlockContainer(anonymous)) [8,8 401.28125x17.46875]
TextPaintable (TextNode<#text>)