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

Commit b15703c9 authored by Alan Viverette's avatar Alan Viverette
Browse files

Avoid double-translating View background

Reverse-translate the canvas before passing to Drawable.draw() so that
we don't double-apply the drawable's translation.

BUG: 18904688
Change-Id: I8450de9b240ddeae887b4e1003c0608da814a001
parent ee2e13e7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -15531,6 +15531,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        final int width = bounds.width();
        final int height = bounds.height();
        final HardwareCanvas canvas = renderNode.start(width, height);
        // Reverse left/top translation done by drawable canvas, which will
        // instead be applied by rendernode's LTRB bounds below. This way, the
        // drawable's bounds match with its rendernode bounds and its content
        // will lie within those bounds in the rendernode tree.
        canvas.translate(-bounds.left, -bounds.top);
        try {
            drawable.draw(canvas);
        } finally {