diff --git a/.DS_Store b/.DS_Store index d21c86f..cdc3fc3 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/GrandMenu/GrandMenu.swift b/GrandMenu/GrandMenu.swift index 3216b40..f4141d8 100644 --- a/GrandMenu/GrandMenu.swift +++ b/GrandMenu/GrandMenu.swift @@ -248,8 +248,7 @@ open class GrandMenu: UIView,GraneMenuItemDelegate { open func adjustScrollOffset(){ let x = selectedItem!.frame.origin.x let right = x + selectedItem!.frame.size.width - print("x:\(x)") - if right < 0.5 * scrollView!.frame.width { + if right <= 0.5 * scrollView!.frame.width { scrollView?.setContentOffset(CGPoint(x: 0, y: 0), animated: true) } else if right > scrollView!.contentSize.width - 0.5 * scrollView!.frame.width{ diff --git a/GrandMenuDemo/.DS_Store b/GrandMenuDemo/.DS_Store index 2419323..48f4ed4 100644 Binary files a/GrandMenuDemo/.DS_Store and b/GrandMenuDemo/.DS_Store differ