Refactor documentation for addBorder and getRelativePosition methods in VisualElement class

This commit is contained in:
Robert Jelic
2025-10-27 17:46:37 +01:00
parent b96875a3e9
commit 2244c84323

View File

@@ -889,10 +889,9 @@ function VisualElement:isFocused()
return self:hasState("focused") return self:hasState("focused")
end end
--- Adds or updates a drawable character border around the element using the canvas plugin. --- Adds or updates a drawable character border around the element using the canvas plugin. The border will automatically adapt to size/background changes because the command reads current properties each render.
--- The border will automatically adapt to size/background changes because the command --- @param colorOrOptions any Border color or options table
--- reads current properties each render. --- @param sideOptions? table Side options table (if color is provided as first argument)
-- @param colorOrOptions any Border color or options table
--- @return VisualElement self --- @return VisualElement self
function VisualElement:addBorder(colorOrOptions, sideOptions) function VisualElement:addBorder(colorOrOptions, sideOptions)
local col = nil local col = nil
@@ -1002,10 +1001,10 @@ end
--- Returns the relative position of the element or the given coordinates. --- Returns the relative position of the element or the given coordinates.
--- @shortDescription Returns the relative position of the element --- @shortDescription Returns the relative position of the element
---@param x? number x position --- @param x? number x position
---@param y? number y position --- @param y? number y position
---@return number x The relative x position --- @return number x The relative x position
---@return number y The relative y position --- @return number y The relative y position
function VisualElement:getRelativePosition(x, y) function VisualElement:getRelativePosition(x, y)
if (x == nil) or (y == nil) then if (x == nil) or (y == nil) then
x, y = self.get("x"), self.get("y") x, y = self.get("x"), self.get("y")