From 0e12fa12cb2cd4e049e560bdad8f1cd654825f3b Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Wed, 12 Nov 2014 11:45:47 -0800 Subject: [PATCH] Add offset method to Outline Also clean up offset docs in Path Change-Id: Ieca02611d32acce726efba652ae1969340a55a76 --- api/current.txt | 1 + graphics/java/android/graphics/Outline.java | 11 +++++++++++ graphics/java/android/graphics/Path.java | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index e2ae6115248c8..d56b2f1862d26 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10928,6 +10928,7 @@ package android.graphics { method public boolean canClip(); method public float getAlpha(); method public boolean isEmpty(); + method public void offset(int, int); method public void set(android.graphics.Outline); method public void setAlpha(float); method public void setConvexPath(android.graphics.Path); diff --git a/graphics/java/android/graphics/Outline.java b/graphics/java/android/graphics/Outline.java index 4bf0b71b6fc21..f76184fe77e10 100644 --- a/graphics/java/android/graphics/Outline.java +++ b/graphics/java/android/graphics/Outline.java @@ -221,4 +221,15 @@ public final class Outline { mRect = null; mRadius = -1.0f; } + + /** + * Offsets the Outline by (dx,dy) + */ + public void offset(int dx, int dy) { + if (mRect != null) { + mRect.offset(dx, dy); + } else if (mPath != null) { + mPath.offset(dx, dy); + } + } } diff --git a/graphics/java/android/graphics/Path.java b/graphics/java/android/graphics/Path.java index c40a66da174f8..0e9823d1661fd 100644 --- a/graphics/java/android/graphics/Path.java +++ b/graphics/java/android/graphics/Path.java @@ -678,7 +678,7 @@ public class Path { } /** - * Offset the path by (dx,dy), returning true on success + * Offset the path by (dx,dy) * * @param dx The amount in the X direction to offset the entire path * @param dy The amount in the Y direction to offset the entire path @@ -695,7 +695,7 @@ public class Path { } /** - * Offset the path by (dx,dy), returning true on success + * Offset the path by (dx,dy) * * @param dx The amount in the X direction to offset the entire path * @param dy The amount in the Y direction to offset the entire path