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

Side by Side Diff: experimental/svg/model/SkSVGEllipse.cpp

Issue 2253283002: [SVGDom] Fix <ellipse> positioning (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkSVGEllipse.h" 9 #include "SkSVGEllipse.h"
10 #include "SkSVGRenderContext.h" 10 #include "SkSVGRenderContext.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 void SkSVGEllipse::onDraw(SkCanvas* canvas, const SkSVGLengthContext& lctx, 58 void SkSVGEllipse::onDraw(SkCanvas* canvas, const SkSVGLengthContext& lctx,
59 const SkPaint& paint) const { 59 const SkPaint& paint) const {
60 const auto cx = lctx.resolve(fCx, SkSVGLengthContext::LengthType::kHorizonta l); 60 const auto cx = lctx.resolve(fCx, SkSVGLengthContext::LengthType::kHorizonta l);
61 const auto cy = lctx.resolve(fCy, SkSVGLengthContext::LengthType::kVertical) ; 61 const auto cy = lctx.resolve(fCy, SkSVGLengthContext::LengthType::kVertical) ;
62 const auto rx = lctx.resolve(fRx, SkSVGLengthContext::LengthType::kHorizonta l); 62 const auto rx = lctx.resolve(fRx, SkSVGLengthContext::LengthType::kHorizonta l);
63 const auto ry = lctx.resolve(fRy, SkSVGLengthContext::LengthType::kVertical) ; 63 const auto ry = lctx.resolve(fRy, SkSVGLengthContext::LengthType::kVertical) ;
64 64
65 if (rx > 0 && ry > 0) { 65 if (rx > 0 && ry > 0) {
66 canvas->drawOval(SkRect::MakeXYWH(cx - rx / 2, cy - ry / 2, rx * 2, ry * 2), paint); 66 canvas->drawOval(SkRect::MakeXYWH(cx - rx, cy - ry, rx * 2, ry * 2), pai nt);
67 } 67 }
68 } 68 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698