mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +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:
@@ -15,7 +15,7 @@ namespace Web::HTML {
|
||||
// https://html.spec.whatwg.org/multipage/images.html#image-source
|
||||
struct ImageSource {
|
||||
struct PixelDensityDescriptorValue {
|
||||
float value { 0 };
|
||||
double value { 0 };
|
||||
};
|
||||
|
||||
struct WidthDescriptorValue {
|
||||
@@ -28,7 +28,7 @@ struct ImageSource {
|
||||
|
||||
struct ImageSourceAndPixelDensity {
|
||||
ImageSource source;
|
||||
float pixel_density { 1.0f };
|
||||
double pixel_density { 1.0f };
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/images.html#source-set
|
||||
|
||||
Reference in New Issue
Block a user