From cda89ca02548c19250ae55671c055536b64b74f8 Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Wed, 5 Feb 2014 17:11:14 -0800 Subject: Fix a bug in Nine Patch library. [DO NOT MERGE] The nine patches were not drawn correctly if they were not positioned at the top left corner of the canvas. Bug: http://b.android.com/29959 Change-Id: Icfed522ea07322a3ee9f3955067d3da26c4b0b5b (cherry-picked from 5bb3414d148f1309dade9333fe9b89c8d1c2f308) --- tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java index be27b54..390044a 100644 --- a/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/NinePatch_Delegate.java @@ -159,7 +159,7 @@ public final class NinePatch_Delegate { /*package*/ static void nativeDraw(int canvas_instance, RectF loc, int bitmap_instance, byte[] c, int paint_instance_or_null, int destDensity, int srcDensity) { draw(canvas_instance, - (int) loc.left, (int) loc.top, (int) loc.width(), (int) loc.height(), + (int) loc.left, (int) loc.top, (int) loc.right, (int) loc.bottom, bitmap_instance, c, paint_instance_or_null, destDensity, srcDensity); } @@ -168,7 +168,7 @@ public final class NinePatch_Delegate { /*package*/ static void nativeDraw(int canvas_instance, Rect loc, int bitmap_instance, byte[] c, int paint_instance_or_null, int destDensity, int srcDensity) { draw(canvas_instance, - loc.left, loc.top, loc.width(), loc.height(), + loc.left, loc.top, loc.right, loc.bottom, bitmap_instance, c, paint_instance_or_null, destDensity, srcDensity); } -- cgit v1.1