Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: experimental/svg/model/SkSVGRect.cpp

Issue 2222793002: [SVGDom] Add <svg> viewBox support (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « experimental/svg/model/SkSVGNode.cpp ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/svg/model/SkSVGRect.cpp
diff --git a/experimental/svg/model/SkSVGRect.cpp b/experimental/svg/model/SkSVGRect.cpp
index 288fc4825828fc9f659452de8e2da392e2a65e09..b65c2b9974b0a99ac8d04fa9980042e5ebffaa33 100644
--- a/experimental/svg/model/SkSVGRect.cpp
+++ b/experimental/svg/model/SkSVGRect.cpp
@@ -58,11 +58,5 @@ void SkSVGRect::onSetAttribute(SkSVGAttribute attr, const SkSVGValue& v) {
void SkSVGRect::onDraw(SkCanvas* canvas, const SkSVGLengthContext& lctx,
const SkPaint& paint) const {
- const SkRect r = SkRect::MakeXYWH(
- lctx.resolve(fX, SkSVGLengthContext::LengthType::kHorizontal),
- lctx.resolve(fY, SkSVGLengthContext::LengthType::kVertical),
- lctx.resolve(fWidth, SkSVGLengthContext::LengthType::kHorizontal),
- lctx.resolve(fHeight, SkSVGLengthContext::LengthType::kVertical));
-
- canvas->drawRect(r, paint);
+ canvas->drawRect(lctx.resolveRect(fX, fY, fWidth, fHeight), paint);
}
« no previous file with comments | « experimental/svg/model/SkSVGNode.cpp ('k') | experimental/svg/model/SkSVGRenderContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698