From 4a7309f4a56f657b01781d2e735bca9d936cf06f Mon Sep 17 00:00:00 2001 From: Ian Ynda-Hummel Date: Thu, 11 May 2017 11:33:50 -0400 Subject: [PATCH] Map scroll directions to actual segment indices in fonts menu --- Source/FolioReaderFontsMenu.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/FolioReaderFontsMenu.swift b/Source/FolioReaderFontsMenu.swift index ceff7e2d0..6fdfb18ee 100644 --- a/Source/FolioReaderFontsMenu.swift +++ b/Source/FolioReaderFontsMenu.swift @@ -243,7 +243,12 @@ class FolioReaderFontsMenu: UIViewController, SMSegmentViewDelegate, UIGestureRe scrollDirection = readerConfig.scrollDirection } - layoutDirection.selectSegmentAtIndex(scrollDirection?.rawValue ?? 0) + switch scrollDirection ?? .vertical { + case .vertical, .defaultVertical: + layoutDirection.selectSegmentAtIndex(FolioReaderScrollDirection.vertical.rawValue) + case .horizontal, .horizontalWithVerticalContent: + layoutDirection.selectSegmentAtIndex(FolioReaderScrollDirection.horizontal.rawValue) + } menuView.addSubview(layoutDirection) }