mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Add type notation
This commit is contained in:
@@ -26,6 +26,21 @@ OTHER DEALINGS IN THE SOFTWARE.
|
||||
local slider = {}
|
||||
slider.__index = slider
|
||||
|
||||
---@type table
|
||||
---@class slider.style
|
||||
---@field width? number
|
||||
---@field orientatio? 'horizontal'|'vertical'
|
||||
---@field track? 'rectangle'|'line'|'roundrect'
|
||||
---@field knob? 'rectangle'|'circle'
|
||||
|
||||
---@param x number
|
||||
---@param y number
|
||||
---@param length number
|
||||
---@param value number
|
||||
---@param min number
|
||||
---@param max number
|
||||
---@param setter? function
|
||||
---@param style? slider.style
|
||||
function newSlider(x, y, length, value, min, max, setter, style)
|
||||
local s = {}
|
||||
s.value = (value - min) / (max - min)
|
||||
|
||||
Reference in New Issue
Block a user