JLChen
2021-02-01 7ab063d5c658143b5bce7ca8e5ae9bfc700bb1d8
EZSDK/EZSDK/EZ/Venders/Masonry/MASViewConstraint.m
old mode 100644 new mode 100755
@@ -1,5 +1,5 @@
//
//  MASConstraint.m
//  MASViewConstraint.m
//  Masonry
//
//  Created by Jonas Budelmann on 20/07/13.
@@ -86,7 +86,7 @@
- (void)setLayoutConstant:(CGFloat)layoutConstant {
    _layoutConstant = layoutConstant;
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
    if (self.useAnimator) {
        [self.layoutConstraint.animator setConstant:layoutConstant];
    } else {
@@ -175,6 +175,7 @@
            NSMutableArray *children = NSMutableArray.new;
            for (id attr in attribute) {
                MASViewConstraint *viewConstraint = [self copy];
                viewConstraint.layoutRelation = relation;
                viewConstraint.secondViewAttribute = attr;
                [children addObject:viewConstraint];
            }
@@ -211,7 +212,7 @@
#pragma mark - Animator proxy
#if TARGET_OS_MAC && !TARGET_OS_IPHONE
#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
- (MASConstraint *)animator {
    self.useAnimator = YES;
@@ -253,6 +254,10 @@
    }
}
- (void)setInset:(CGFloat)inset {
    [self setInsets:(MASEdgeInsets){.top = inset, .left = inset, .bottom = inset, .right = inset}];
}
- (void)setOffset:(CGFloat)offset {
    self.layoutConstant = offset;
}
@@ -288,28 +293,21 @@
#pragma mark - MASConstraint
- (void)activate {
    if ([self supportsActiveProperty] && self.layoutConstraint) {
        if (self.hasBeenInstalled) {
            return;
        }
        self.layoutConstraint.active = YES;
        [self.firstViewAttribute.view.mas_installedConstraints addObject:self];
    } else {
        [self install];
    }
    [self install];
}
- (void)deactivate {
    if ([self supportsActiveProperty]) {
        self.layoutConstraint.active = NO;
        [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
    } else {
        [self uninstall];
    }
    [self uninstall];
}
- (void)install {
    if (self.hasBeenInstalled) {
        return;
    }
    if ([self supportsActiveProperty] && self.layoutConstraint) {
        self.layoutConstraint.active = YES;
        [self.firstViewAttribute.view.mas_installedConstraints addObject:self];
        return;
    }
    
@@ -387,6 +385,12 @@
}
- (void)uninstall {
    if ([self supportsActiveProperty]) {
        self.layoutConstraint.active = NO;
        [self.firstViewAttribute.view.mas_installedConstraints removeObject:self];
        return;
    }
    [self.installedView removeConstraint:self.layoutConstraint];
    self.layoutConstraint = nil;
    self.installedView = nil;