mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:37:45 +00:00
LibWeb: Make CSSPixels and Length use 64-bit (double) floating point
This fixes a plethora of rounding problems on many websites. In the future, we may want to replace this with fixed-point arithmetic (bug #18566) for performance (and consistency with other engines), but in the meantime this makes the web look a bit better. :^) There's a lot more things that could be converted to doubles, which would reduce the amount of casting necessary in this patch. We can do that incrementally, however.
This commit is contained in:
parent
30262d7023
commit
655d9d1462
80 changed files with 298 additions and 299 deletions
|
@ -18,7 +18,7 @@ namespace Web {
|
|||
|
||||
class PaintContext {
|
||||
public:
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, float device_pixels_per_css_pixel);
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, double device_pixels_per_css_pixel);
|
||||
|
||||
Gfx::Painter& painter() const { return m_painter; }
|
||||
Palette const& palette() const { return m_palette; }
|
||||
|
@ -64,13 +64,13 @@ public:
|
|||
return clone;
|
||||
}
|
||||
|
||||
float device_pixels_per_css_pixel() const { return m_device_pixels_per_css_pixel; }
|
||||
double device_pixels_per_css_pixel() const { return m_device_pixels_per_css_pixel; }
|
||||
|
||||
private:
|
||||
Gfx::Painter& m_painter;
|
||||
Palette m_palette;
|
||||
Optional<SVGContext> m_svg_context;
|
||||
float m_device_pixels_per_css_pixel;
|
||||
double m_device_pixels_per_css_pixel { 0 };
|
||||
DevicePixelRect m_device_viewport_rect;
|
||||
bool m_should_show_line_box_borders { false };
|
||||
bool m_focus { false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue