mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
@@ -14,7 +14,7 @@ GridSize::GridSize(LengthPercentage length_percentage)
|
||||
: m_type(Type::LengthPercentage)
|
||||
, m_length_percentage(length_percentage) {};
|
||||
|
||||
GridSize::GridSize(float flex_factor)
|
||||
GridSize::GridSize(double flex_factor)
|
||||
: m_type(Type::FlexibleLength)
|
||||
, m_length_percentage { Length::make_px(0) }
|
||||
, m_flex_factor(flex_factor)
|
||||
|
||||
Reference in New Issue
Block a user