diff --git a/GMGridView/GMGridView.h b/GMGridView/GMGridView.h index 7282e1d..f13e9bd 100644 --- a/GMGridView/GMGridView.h +++ b/GMGridView/GMGridView.h @@ -84,6 +84,7 @@ typedef enum @property (nonatomic) UIEdgeInsets minEdgeInsets; // Default is (5, 5, 5, 5) @property (nonatomic) CFTimeInterval minimumPressDuration; // Default is 0.2; if set to 0, the view wont be scrollable @property (nonatomic) BOOL showFullSizeViewWithAlphaWhenTransforming; // Default is YES - not working right now +@property (nonatomic) float scaleOnPan; // Default is 1.1 @property (nonatomic) BOOL enableEditOnLongPress; // Default is NO @property (nonatomic) BOOL disableEditOnEmptySpaceTap; // Default is NO diff --git a/GMGridView/GMGridView.m b/GMGridView/GMGridView.m index c362c29..abcdbdb 100644 --- a/GMGridView/GMGridView.m +++ b/GMGridView/GMGridView.m @@ -144,6 +144,7 @@ @implementation GMGridView @synthesize minEdgeInsets = _minEdgeInsets; @synthesize showFullSizeViewWithAlphaWhenTransforming; @synthesize editing = _editing; +@synthesize scaleOnPan=_scaleOnPan; @synthesize enableEditOnLongPress; @synthesize disableEditOnEmptySpaceTap; @@ -245,6 +246,7 @@ - (void)commonInit self.editing = NO; self.itemSpacing = 10; self.style = GMGridViewStyleSwap; + self.scaleOnPan = 1.1f; self.minimumPressDuration = 0.2; self.showFullSizeViewWithAlphaWhenTransforming = YES; self.minEdgeInsets = UIEdgeInsetsMake(5, 5, 5, 5); @@ -570,6 +572,8 @@ - (void)longPressGestureUpdated:(UILongPressGestureRecognizer *)longPressGesture { [_sortingPanGesture end]; + _sortMovingItem.transform = CGAffineTransformMakeScale(self.scaleOnPan, self.scaleOnPan); + if (_sortMovingItem) { CGPoint location = [longPressGesture locationInView:self]; @@ -607,7 +611,8 @@ - (void)sortingPanGestureUpdated:(UIPanGestureRecognizer *)panGesture CGPoint offset = translation; CGPoint locationInScroll = [panGesture locationInView:self]; - _sortMovingItem.transform = CGAffineTransformMakeTranslation(offset.x, offset.y); + _sortMovingItem.transform = CGAffineTransformConcat(CGAffineTransformMakeScale(self.scaleOnPan, self.scaleOnPan), + CGAffineTransformMakeTranslation(offset.x, offset.y)); [self sortingMoveDidContinueToPoint:locationInScroll]; break; @@ -709,6 +714,7 @@ - (void)sortingMoveDidStartAtPoint:(CGPoint)point [self bringSubviewToFront:item]; _sortMovingItem = item; + _sortMovingItem.transform = CGAffineTransformMakeScale(self.scaleOnPan, self.scaleOnPan); CGRect frameInMainView = [self convertRect:_sortMovingItem.frame toView:self.mainSuperView];