[SVG] Fix application of skewX/skewY attributes

The SkMatrix setSkew functions set the matrix value directly, so we need
to treat the angle according to
https://www.w3.org/TR/SVG11/coords.html#SkewXDefined

Change-Id: I3a47e4e98724ef71f39a00dc2f07c8bf430de747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282268
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
This commit is contained in:
Tyler Denniston 2020-04-08 13:02:41 -04:00 committed by Skia Commit-Bot
parent d2c24c8aad
commit d1e5b030fd

View File

@ -373,7 +373,7 @@ bool SkSVGAttributeParser::parseSkewXToken(SkMatrix* matrix) {
if (!this->parseScalarToken(&angle)) {
return false;
}
m->setSkewX(angle);
m->setSkewX(tanf(SkDegreesToRadians(angle)));
return true;
}, matrix);
}
@ -384,7 +384,7 @@ bool SkSVGAttributeParser::parseSkewYToken(SkMatrix* matrix) {
if (!this->parseScalarToken(&angle)) {
return false;
}
m->setSkewY(angle);
m->setSkewY(tanf(SkDegreesToRadians(angle)));
return true;
}, matrix);
}