Very small fixes

- Visual border fix
- Fix with :setSize (if you are creating a dynamic value and after that you just want to add a number to it, it would crash)
This commit is contained in:
Robert Jelic
2022-09-19 21:04:26 +02:00
parent a6c47ce61a
commit 45c430867f
2 changed files with 23 additions and 23 deletions

View File

@@ -273,10 +273,10 @@ return function(name)
setSize = function(self, width, height, rel) setSize = function(self, width, height, rel)
if(type(width)=="number")then if(type(width)=="number")then
self.width = rel and self.width+width or width self.width = rel and self:getWidth()+width or width
end end
if(type(height)=="number")then if(type(height)=="number")then
self.height = rel and self.height+height or height self.height = rel and self:getHeight()+height or height
end end
if(self.parent~=nil)then if(self.parent~=nil)then
if(type(width)=="string")then if(type(width)=="string")then
@@ -439,29 +439,29 @@ return function(name)
self.parent:drawForegroundBox(x, y, 1, 1, borderColors["left"]) self.parent:drawForegroundBox(x, y, 1, 1, borderColors["left"])
end end
if(borderColors["right"]~=false)then if(borderColors["right"]~=false)then
self.parent:drawTextBox(x+w, y, 1, h, "\149") self.parent:drawTextBox(x+w-1, y, 1, h, "\149")
if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y, 1, h, self.bgColor) end if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y, 1, h, self.bgColor) end
self.parent:drawBackgroundBox(x+w, y, 1, h, borderColors["right"]) self.parent:drawBackgroundBox(x+w-1, y, 1, h, borderColors["right"])
end
if(borderColors["top"]~=false)and(borderColors["right"]~=false)then
self.parent:drawTextBox(x+w, y, 1, 1, "\148")
if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y, 1, 1, self.bgColor) end
self.parent:drawBackgroundBox(x+w, y, 1, 1, borderColors["right"])
end
if(borderColors["right"]~=false)and(borderColors["bottom"]~=false)then
self.parent:drawTextBox(x+w, y+h, 1, 1, "\133")
if(bgCol~=false)then self.parent:drawForegroundBox(x+w, y+h, 1, 1, self.bgColor) end
self.parent:drawBackgroundBox(x+w, y+h, 1, 1, borderColors["right"])
end end
if(borderColors["bottom"]~=false)then if(borderColors["bottom"]~=false)then
self.parent:drawTextBox(x, y+h, w, 1, "\143") self.parent:drawTextBox(x, y+h-1, w, 1, "\143")
if(bgCol~=false)then self.parent:drawForegroundBox(x, y+h, w, 1, self.bgColor) end if(bgCol~=false)then self.parent:drawForegroundBox(x, y+h-1, w, 1, self.bgColor) end
self.parent:drawBackgroundBox(x, y+h, w, 1, borderColors["bottom"]) self.parent:drawBackgroundBox(x, y+h-1, w, 1, borderColors["bottom"])
end
if(borderColors["top"]~=false)and(borderColors["right"]~=false)then
self.parent:drawTextBox(x+w-1, y, 1, 1, "\148")
if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y, 1, 1, self.bgColor) end
self.parent:drawBackgroundBox(x+w-1, y, 1, 1, borderColors["right"])
end
if(borderColors["right"]~=false)and(borderColors["bottom"]~=false)then
self.parent:drawTextBox(x+w-1, y+h-1, 1, 1, "\133")
if(bgCol~=false)then self.parent:drawForegroundBox(x+w-1, y+h-1, 1, 1, self.bgColor) end
self.parent:drawBackgroundBox(x+w-1, y+h-1, 1, 1, borderColors["right"])
end end
if(borderColors["bottom"]~=false)and(borderColors["left"]~=false)then if(borderColors["bottom"]~=false)and(borderColors["left"]~=false)then
self.parent:drawTextBox(x, y+h, 1, 1, "\138") self.parent:drawTextBox(x, y+h-1, 1, 1, "\138")
if(bgCol~=false)then self.parent:drawForegroundBox(x-1, y+h, 1, 1, self.bgColor) end if(bgCol~=false)then self.parent:drawForegroundBox(x-1, y+h-1, 1, 1, self.bgColor) end
self.parent:drawBackgroundBox(x, y+h, 1, 1, borderColors["left"]) self.parent:drawBackgroundBox(x, y+h-1, 1, 1, borderColors["left"])
end end
end end
draw = false draw = false

View File

@@ -362,9 +362,9 @@ return function(name)
return self return self
end, end,
add = function(self, func, wait) add = function(self, func, timer)
lastFunc = func lastFunc = func
addAnimationPart((wait or nextWaitTimer) + (animations[#animations]~=nil and animations[#animations].t or 0), func) addAnimationPart((timer or nextWaitTimer) + (animations[#animations]~=nil and animations[#animations].t or 0), func)
return self return self
end; end;