From 888f7c8968de105ae52f516e1ea5d70e69f850e1 Mon Sep 17 00:00:00 2001 From: Tim Luo Date: Mon, 7 Mar 2016 17:16:38 -0600 Subject: [PATCH] Reset handle bounds when setting handle width --- WKVerticalScrollBar/WKVerticalScrollBar.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WKVerticalScrollBar/WKVerticalScrollBar.m b/WKVerticalScrollBar/WKVerticalScrollBar.m index f99a9e1..fbd01be 100644 --- a/WKVerticalScrollBar/WKVerticalScrollBar.m +++ b/WKVerticalScrollBar/WKVerticalScrollBar.m @@ -174,6 +174,19 @@ - (void)setHandleSelectedCornerRadius:(CGFloat)handleSelectedCornerRadius } } +- (CGFloat)handleWidth +{ + return _handleWidth; +} + +- (void)setHandleWidth:(CGFloat)handleWidth +{ + _handleWidth = handleWidth; + if (!handleDragged) { + [handle setBounds:CGRectMake(0, 0, _handleWidth, [handle bounds].size.height)]; + } +} + - (void)layoutSubviews { [super layoutSubviews];