Initial commit
This commit is contained in:
49
koptilnya/gui/elements/radius_mixin.txt
Normal file
49
koptilnya/gui/elements/radius_mixin.txt
Normal file
@@ -0,0 +1,49 @@
|
||||
--@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
|
||||
Reference in New Issue
Block a user