Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions GMGridView/GMGridView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion GMGridView/GMGridView.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ @implementation GMGridView
@synthesize minEdgeInsets = _minEdgeInsets;
@synthesize showFullSizeViewWithAlphaWhenTransforming;
@synthesize editing = _editing;
@synthesize scaleOnPan=_scaleOnPan;
@synthesize enableEditOnLongPress;
@synthesize disableEditOnEmptySpaceTap;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -570,6 +572,8 @@ - (void)longPressGestureUpdated:(UILongPressGestureRecognizer *)longPressGesture
{
[_sortingPanGesture end];

_sortMovingItem.transform = CGAffineTransformMakeScale(self.scaleOnPan, self.scaleOnPan);

if (_sortMovingItem)
{
CGPoint location = [longPressGesture locationInView:self];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];

Expand Down