You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/06/13 09:48:53 UTC

[GitHub] [incubator-weex] YorkShen commented on a change in pull request #2279: [Android] fix OP.REPLACE is not allow above api 26

YorkShen commented on a change in pull request #2279: [Android] fix OP.REPLACE is not allow above api 26
URL: https://github.com/apache/incubator-weex/pull/2279#discussion_r293294977
 
 

 ##########
 File path: android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
 ##########
 @@ -399,7 +399,13 @@ public void draw(Canvas canvas) {
       Rect newRect = new Rect(bounds);
       // Make the Canvas Rect bigger according to the padding.
       newRect.inset(-paddingX * 2, -paddingY * 2);
-      canvas.clipRect(newRect, Region.Op.REPLACE);
+
+      // Region.Op.REPLACE is not allow above api 26
+      if (Build.VERSION.SDK_INT >= 26) {
+        canvas.clipRect(newRect);
 
 Review comment:
   After some research, I found the implementation of box shadow relies on `canvas.clipRect(newRect, Region.Op.REPLACE);`. Without this line, the box-shadow will never draw beyond the view's bounds.
   
   I am going to disable box-shadow on Android P or higher and merged your PR.
   
   Thanks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services