starfall-data/koptilnya/gui/elements/radius_mixin.txt
Nikita Kruglickiy 1a0785862d Initial commit
2020-12-25 22:18:23 +06:00

49 lines
1.5 KiB
Plaintext

--@include ../utils.txt
require("../utils.txt")
local MIXIN = {}
accessorFunc(MIXIN, "_radius", "Radius", 0)
function MIXIN:included(target)
self._roundTopLeftCorner = false
self._roundTopRightCorner = false
self._roundBottomLeftCorner = false
self._roundBottomRightCorner = false
end
function MIXIN:setRoundedCorners(c1, c2, c3, c4)
if c1 ~= nil and c2 ~= nil and c3 ~= nil and c4 ~= nil then
self._roundTopLeftCorner = c1
self._roundTopRightCorner = c2
self._roundBottomRightCorner = c3
self._roundBottomLeftCorner = c4
elseif c1 ~= nil and c2 ~= nil and c3 ~= nil then
self._roundTopLeftCorner = c1
self._roundTopRightCorner = c2
self._roundBottomRightCorner = c3
self._roundBottomLeftCorner = c2
elseif c1 ~= nil and c2 ~= nil then
self._roundTopLeftCorner = c1
self._roundTopRightCorner = c2
self._roundBottomRightCorner = c1
self._roundBottomLeftCorner = c2
elseif c1 ~= nil then
self._roundTopLeftCorner = c1
self._roundTopRightCorner = c1
self._roundBottomRightCorner = c1
self._roundBottomLeftCorner = c1
else
self._roundTopLeftCorner = false
self._roundTopRightCorner = false
self._roundBottomRightCorner = false
self._roundBottomLeftCorner = false
end
end
function MIXIN:getRoundedCorners()
return self._roundTopLeftCorner, self._roundTopRightCorner, self._roundBottomRightCorner, self._roundBottomLeftCorner
end
return MIXIN