Parcourir la source

Fix edges to edges for macOS

Robert Payne il y a 9 ans
Parent
commit
46c02e3cc9
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      Source/Constraint.swift

+ 3 - 1
Source/Constraint.swift

@@ -118,7 +118,9 @@ public class Constraint {
                     layoutToAttribute = layoutFromAttribute
                     layoutToAttribute = layoutFromAttribute
                 }
                 }
             #else
             #else
-                if layoutToAttributes.count > 0 {
+                if self.from.attributes == self.to.attributes {
+                    layoutToAttribute = layoutFromAttribute
+                } else if layoutToAttributes.count > 0 {
                     layoutToAttribute = layoutToAttributes[0]
                     layoutToAttribute = layoutToAttributes[0]
                 } else {
                 } else {
                     layoutToAttribute = layoutFromAttribute
                     layoutToAttribute = layoutFromAttribute