mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-29 10:54:48 +03:00
Make scroll bar functions explicitly handle zero-height/width content cases
This commit is contained in:
parent
9ca9a39b89
commit
4dd85869eb
@ -1330,6 +1330,8 @@ verticalScrollbar :: ScrollbarRenderer n
|
||||
-> Int
|
||||
-- ^ The total viewport content height.
|
||||
-> Widget n
|
||||
verticalScrollbar vsRenderer vpHeight _ 0 =
|
||||
hLimit 1 $ vLimit vpHeight $ renderScrollbarTrough vsRenderer
|
||||
verticalScrollbar vsRenderer vpHeight vOffset contentHeight =
|
||||
-- Get the proportion of the total content that is visible
|
||||
let visibleContentPercent :: Double
|
||||
@ -1382,6 +1384,8 @@ horizontalScrollbar :: ScrollbarRenderer n
|
||||
-> Int
|
||||
-- ^ The total viewport content width.
|
||||
-> Widget n
|
||||
horizontalScrollbar hsRenderer vpWidth _ 0 =
|
||||
vLimit 1 $ hLimit vpWidth $ renderScrollbarTrough hsRenderer
|
||||
horizontalScrollbar hsRenderer vpWidth hOffset contentWidth =
|
||||
-- Get the proportion of the total content that is visible
|
||||
let visibleContentPercent :: Double
|
||||
|
Loading…
Reference in New Issue
Block a user