Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Quick fix for the positioning on devices < IOS8 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions Pod/Classes/JVFloatingDrawerSpringAnimator.m
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ - (void)applyTransformsWithSide:(JVFloatingDrawerSide)drawerSide sideView:(UIVie
CGFloat centerWidth = centerView.bounds.size.width;
CGFloat centerViewHorizontalOffset = direction * sideWidth;
CGFloat scaledCenterViewHorizontalOffset = direction * (sideWidth - (centerWidth - kJVCenterViewDestinationScale * centerWidth) / 2.0);

/*
- Quick fix for IOS < 8 devices
- Seems like in IOS8+ CGAffineTransformMakeTranslation already multiply with the scale.
*/
if ([[UIDevice currentDevice] systemVersion].floatValue < 8) {
scaledCenterViewHorizontalOffset *= [UIScreen mainScreen].scale;
centerViewHorizontalOffset *= [UIScreen mainScreen].scale;
}

CGAffineTransform sideTranslate = CGAffineTransformMakeTranslation(centerViewHorizontalOffset, 0.0);
sideView.transform = sideTranslate;
Expand Down