mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
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
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
Add a link
Reference in a new issue