You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by mo...@apache.org on 2019/12/11 08:48:55 UTC

[incubator-weex] branch master updated: [iOS] fix waterfall component repaint bug

This is an automated email from the ASF dual-hosted git repository.

moshen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 81abb4a  [iOS] fix waterfall component repaint bug
     new 0ea76d5  Merge pull request #3073 from jianhan-he/master
81abb4a is described below

commit 81abb4a9bc88d0b4aa81adfcff072484d421ec44
Author: linghe.lh <li...@alibaba-inc.com>
AuthorDate: Wed Dec 11 16:18:23 2019 +0800

    [iOS] fix waterfall component repaint bug
---
 .../Component/Recycler/WXRecyclerComponent.mm      | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm
index bc246b4..22be575 100644
--- a/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Component/Recycler/WXRecyclerComponent.mm
@@ -252,18 +252,26 @@ typedef enum : NSUInteger {
         }
         
         if (attributes[@"columnWidth"]) {
-            layout.columnWidth = [WXConvert WXLength:attributes[@"columnWidth"] isFloat:YES scaleFactor:scaleFactor];
-            needUpdateLayout = YES;
+            WXLength* columnWidth = [WXConvert WXLength:attributes[@"columnWidth"] isFloat:YES scaleFactor:scaleFactor];
+            if (![columnWidth isEqualToLength:layout.columnWidth]) {
+                layout.columnWidth = columnWidth;
+                needUpdateLayout = YES;
+            }
         }
         
         if (attributes[@"columnCount"]) {
-            layout.columnCount = [WXConvert WXLength:attributes[@"columnCount"] isFloat:NO scaleFactor:1.0];
-            
-            needUpdateLayout = YES;
+            WXLength* columCount = [WXConvert WXLength:attributes[@"columnCount"] isFloat:NO scaleFactor:1.0];
+            if (![columCount isEqualToLength:layout.columnCount]) {
+                layout.columnCount = columCount;
+                needUpdateLayout = YES;
+            }
         }
         if (attributes[@"columnGap"]) {
-            layout.columnGap = [self _floatValueForColumnGap:([WXConvert WXLength:attributes[@"columnGap"] isFloat:YES scaleFactor:scaleFactor])];
-            needUpdateLayout = YES;
+            float columnGap = [self _floatValueForColumnGap:([WXConvert WXLength:attributes[@"columnGap"] isFloat:YES scaleFactor:scaleFactor])];
+            if (columnGap != layout.columnGap) {
+                layout.columnGap = columnGap;
+                needUpdateLayout = YES;
+            }
         }
         if (attributes[@"leftGap"]) {
             layout.leftGap = [WXConvert WXPixelType:attributes[@"leftGap"] scaleFactor:scaleFactor];