限制文本框滑块尺寸

This commit is contained in:
MrZ626
2021-01-27 10:44:16 +08:00
parent 28e31472fe
commit 91ee6b9f56

View File

@@ -891,7 +891,7 @@ function textBox:draw()
if #texts>cap then
gc.setLineWidth(2)
gc.rectangle("line",x-25,y,20,h)
local len=h*cap/#texts
local len=max(h*cap/#texts,26)
gc.setColor(COLOR[WIDGET.sel==self and"Y"or"W"])
gc.rectangle("fill",x-22,y+(h-len-6)*(scroll-cap)/(#texts-cap)+3,14,len)
end