am a0fb87a3: am 98c3461a: Merge "Do not paint shadow if outside of the clip area" into lmp-dev automerge: a912fed
* commit 'a0fb87a3b831e8eb4e4f7e03fc170cf8f93a2161': Do not paint shadow if outside of the clip area
This commit is contained in:
@@ -71,8 +71,10 @@ public class ViewGroup_Delegate {
|
|||||||
int x = 0;
|
int x = 0;
|
||||||
if (outline.mRect != null) {
|
if (outline.mRect != null) {
|
||||||
Shadow s = getRectShadow(parent, canvas, child, outline);
|
Shadow s = getRectShadow(parent, canvas, child, outline);
|
||||||
shadow = s.mShadow;
|
if (s != null) {
|
||||||
x = -s.mShadowWidth;
|
shadow = s.mShadow;
|
||||||
|
x = -s.mShadowWidth;
|
||||||
|
}
|
||||||
} else if (outline.mPath != null) {
|
} else if (outline.mPath != null) {
|
||||||
shadow = getPathShadow(child, outline, canvas);
|
shadow = getPathShadow(child, outline, canvas);
|
||||||
}
|
}
|
||||||
@@ -132,6 +134,9 @@ public class ViewGroup_Delegate {
|
|||||||
|
|
||||||
private static BufferedImage getPathShadow(View child, Outline outline, Canvas canvas) {
|
private static BufferedImage getPathShadow(View child, Outline outline, Canvas canvas) {
|
||||||
Rect clipBounds = canvas.getClipBounds();
|
Rect clipBounds = canvas.getClipBounds();
|
||||||
|
if (clipBounds.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
BufferedImage image = new BufferedImage(clipBounds.width(), clipBounds.height(),
|
BufferedImage image = new BufferedImage(clipBounds.width(), clipBounds.height(),
|
||||||
BufferedImage.TYPE_INT_ARGB);
|
BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D graphics = image.createGraphics();
|
Graphics2D graphics = image.createGraphics();
|
||||||
|
|||||||
Reference in New Issue
Block a user