Skip to content
Snippets Groups Projects
Commit a912fedb authored by Diego Perez's avatar Diego Perez Committed by Android Git Automerger
Browse files

am 98c3461a: Merge "Do not paint shadow if outside of the clip area" into lmp-dev

* commit '98c3461a':
  Do not paint shadow if outside of the clip area
parents 4e474160 98c3461a
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,10 @@ public class ViewGroup_Delegate {
int x = 0;
if (outline.mRect != null) {
Shadow s = getRectShadow(parent, canvas, child, outline);
shadow = s.mShadow;
x = -s.mShadowWidth;
if (s != null) {
shadow = s.mShadow;
x = -s.mShadowWidth;
}
} else if (outline.mPath != null) {
shadow = getPathShadow(child, outline, canvas);
}
......@@ -132,6 +134,9 @@ public class ViewGroup_Delegate {
private static BufferedImage getPathShadow(View child, Outline outline, Canvas canvas) {
Rect clipBounds = canvas.getClipBounds();
if (clipBounds.isEmpty()) {
return null;
}
BufferedImage image = new BufferedImage(clipBounds.width(), clipBounds.height(),
BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = image.createGraphics();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment