You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mi...@apache.org on 2017/09/27 10:09:38 UTC
[4/4] incubator-weex git commit: * [android] fix negative offset
* [android] fix negative offset
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/27f69b75
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/27f69b75
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/27f69b75
Branch: refs/heads/0.16-dev
Commit: 27f69b75a2881afcc229a78e00b43ae2a2d0abd6
Parents: 007dd16
Author: misakuo <mi...@apache.org>
Authored: Wed Sep 27 18:05:08 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Wed Sep 27 18:05:08 2017 +0800
----------------------------------------------------------------------
.../main/java/com/taobao/weex/utils/BoxShadowUtil.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/27f69b75/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java b/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
index 892e80c..3f522dd 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
@@ -139,8 +139,14 @@ public class BoxShadowUtil {
viewWidth + 2f * shadowSpread, viewHeight + 2f * shadowSpread
);
- float shadowDx = 2f * dx + shadowRadius;
- float shadowDy = 2f * dy + shadowRadius;
+ float shadowDx = shadowRadius;
+ float shadowDy = shadowRadius;
+ if (dx > 0) {
+ shadowDx = shadowDx + 2f * dx;
+ }
+ if (dy > 0) {
+ shadowDy = shadowDy + 2f * dy;
+ }
shadowRect.offset(shadowDx, shadowDy);
Paint shadowPaint = new Paint();