Эх сурвалжийг харах

Fix for debug description in case if constant equals to 0

Pavel Mazurin 11 жил өмнө
parent
commit
499ef3536b

+ 4 - 4
Masonry/NSLayoutConstraint+MASDebugAdditions.m

@@ -110,10 +110,10 @@
         [description appendFormat:@" * %g", self.multiplier];
         [description appendFormat:@" * %g", self.multiplier];
     }
     }
     
     
-    if (self.constant) {
-        if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) {
-            [description appendFormat:@" %g", self.constant];
-        } else {
+    if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) {
+        [description appendFormat:@" %g", self.constant];
+    } else {
+        if (self.constant) {
             [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)];
             [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)];
         }
         }
     }
     }