Skip to content

Commit

Permalink
Scrollbar slider min size based on orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
Oen44 committed Oct 31, 2024
1 parent 103f474 commit 1a6ec4f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/corelib/ui/uiscrollbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ local function calcValues(self)
proportion = math.min(math.max(self.step, 1), range)/range
end

local px = math.max(proportion * pxrange, math.min(30, self:getHeight() - 24))
if g_app.isMobile() then
px = math.max(proportion * pxrange, math.min(30, self:getHeight() - 24))
local minSize = 0
if self.orientation == 'vertical' then
minSize = math.min(30, self:getHeight() - 24)
else
minSize = math.min(30, self:getWidth() - 24)
end
local px = math.max(proportion * pxrange, minSize)
px = px - px % 2 + 1

local offset = 0
Expand Down

0 comments on commit 1a6ec4f

Please sign in to comment.