LibWeb: Support skew{X,Y} in stacking context transforms
https://drafts.csswg.org/css-transforms/#SkewDefined
This commit is contained in:
parent
34cd7f4c22
commit
fb33514029
Notes:
sideshowbarker
2024-07-17 07:14:09 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/fb33514029 Pull-request: https://github.com/SerenityOS/serenity/pull/20464
1 changed files with 26 additions and 0 deletions
|
@ -341,6 +341,32 @@ Gfx::FloatMatrix4x4 StackingContext::get_transformation_matrix(CSS::Transformati
|
|||
if (count == 1)
|
||||
return Gfx::rotation_matrix({ 0.0f, 0.0f, 1.0f }, value(0));
|
||||
break;
|
||||
case CSS::TransformFunction::Skew:
|
||||
if (count == 1)
|
||||
return Gfx::FloatMatrix4x4(1, tanf(value(0)), 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
if (count == 2)
|
||||
return Gfx::FloatMatrix4x4(1, tanf(value(0)), 0, 0,
|
||||
tanf(value(1)), 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
break;
|
||||
case CSS::TransformFunction::SkewX:
|
||||
if (count == 1)
|
||||
return Gfx::FloatMatrix4x4(1, tanf(value(0)), 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
break;
|
||||
case CSS::TransformFunction::SkewY:
|
||||
if (count == 1)
|
||||
return Gfx::FloatMatrix4x4(1, 0, 0, 0,
|
||||
tanf(value(0)), 1, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, 0, 0, 1);
|
||||
break;
|
||||
default:
|
||||
dbgln_if(LIBWEB_CSS_DEBUG, "FIXME: Unhandled transformation function {}", MUST(CSS::TransformationStyleValue::create(transformation.function, {}))->to_string());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue