mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 15:19:16 +00:00
LibWeb/CSS: Separate IntegerSV and NumberSV from CSSUnitValue
This inheritance exists for typed-om classes, but StyleValues aren't
typed-om.
Somehow this makes our z-index interpolation slightly more correct. 🎉
This commit is contained in:
parent
51a657ca47
commit
7157d19f56
Notes:
github-actions[bot]
2025-08-08 14:20:36 +00:00
Author: https://github.com/AtkinsSJ
Commit: 7157d19f56
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5775
Reviewed-by: https://github.com/tcl3 ✅
10 changed files with 23 additions and 25 deletions
|
@ -1151,8 +1151,8 @@ static RefPtr<StyleValue const> interpolate_value_impl(DOM::Element& element, Ca
|
|||
// https://drafts.csswg.org/css-values/#combine-integers
|
||||
// Interpolation of <integer> is defined as Vresult = round((1 - p) × VA + p × VB);
|
||||
// that is, interpolation happens in the real number space as for <number>s, and the result is converted to an <integer> by rounding to the nearest integer.
|
||||
auto interpolated_value = interpolate_raw(from.as_integer().value(), to.as_integer().value(), delta);
|
||||
return IntegerStyleValue::create(round_to<i64>(interpolated_value));
|
||||
auto interpolated_value = interpolate_raw(from.as_integer().integer(), to.as_integer().integer(), delta);
|
||||
return IntegerStyleValue::create(interpolated_value);
|
||||
}
|
||||
case StyleValue::Type::Length: {
|
||||
auto const& from_length = from.as_length().length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue