Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2300b834 authored by Doris Liu's avatar Doris Liu Committed by Android (Google) Code Review
Browse files

Merge "Properly handle the negative scaling factor of canvas in VectorDrawable"

parents fdbdb9f9 e410a357
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -407,8 +407,9 @@ void Tree::draw(Canvas* outCanvas, SkColorFilter* colorFilter,
    float canvasScaleY = 1.0f;
    if (mCanvasMatrix.getSkewX() == 0 && mCanvasMatrix.getSkewY() == 0) {
        // Only use the scale value when there's no skew or rotation in the canvas matrix.
        canvasScaleX = mCanvasMatrix.getScaleX();
        canvasScaleY = mCanvasMatrix.getScaleY();
        // TODO: Add a cts test for drawing VD on a canvas with negative scaling factors.
        canvasScaleX = fabs(mCanvasMatrix.getScaleX());
        canvasScaleY = fabs(mCanvasMatrix.getScaleY());
    }
    int scaledWidth = (int) (mBounds.width() * canvasScaleX);
    int scaledHeight = (int) (mBounds.height() * canvasScaleY);