//
//  UIView+Frame.m
//  GMAlpha
//
//  Created by Q14 on 2018/11/5.
//  Copyright © 2018年 Gengmei. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)
- (void)setGm_height:(CGFloat)gm_height {
    CGRect rect = self.frame;
    rect.size.height = gm_height;
    self.frame = rect;
}

- (CGFloat)gm_height {
    return self.frame.size.height;
}

- (CGFloat)gm_width {
    return self.frame.size.width;
}
- (void)setGm_width:(CGFloat)gm_width {
    CGRect rect = self.frame;
    rect.size.width = gm_width;
    self.frame = rect;
}

- (CGFloat)gm_x {
    return self.frame.origin.x;
    
}

- (void)setGm_x:(CGFloat)gm_x {
    CGRect rect = self.frame;
    rect.origin.x = gm_x;
    self.frame = rect;
}

- (void)setGm_y:(CGFloat)gm_y {
    CGRect rect = self.frame;
    rect.origin.y = gm_y;
    self.frame = rect;
}

- (CGFloat)gm_y {
    
    return self.frame.origin.y;
}

- (void)setGm_centerX:(CGFloat)gm_centerX {
    CGPoint center = self.center;
    center.x = gm_centerX;
    self.center = center;
}

- (CGFloat)gm_centerX {
    return self.center.x;
}

- (void)setGm_centerY:(CGFloat)gm_centerY {
    CGPoint center = self.center;
    center.y = gm_centerY;
    self.center = center;
}

- (CGFloat)gm_centerY {
    return self.center.y;
}
@end
