diff options
| author | 2015-01-05 22:40:24 +0000 | |
|---|---|---|
| committer | 2015-01-05 22:40:24 +0000 | |
| commit | 8a3323adc8cc8712d3ea6e03b4cb65553ffa15c0 (patch) | |
| tree | 43ff0d761d5056fb9057f4c6edb408189184c835 | |
| parent | 58958678010910a3e8eca6ef574e2dd7f12aec42 (diff) | |
| parent | 4d41e49f39322ae5ceee375e515636e29ed2dfbc (diff) | |
am bde76419: am 1f3f47b3: Merge "Avoid double-translating View background" into lmp-mr1-dev
automerge: 4d41e49
* commit '4d41e49f39322ae5ceee375e515636e29ed2dfbc':
Avoid double-translating View background
| -rw-r--r-- | core/java/android/view/View.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index bc6ca8f1b934..12c0510a6713 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -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 { |