Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
Small XML borderColor fix
  • Loading branch information
NoryiE committed Feb 20, 2023
1 parent 50dce1c commit 6f0ddd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Basalt/Object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ return function(name)
if(xmlValue("anchor", data)~=nil)then self:setAnchor(xmlValue("anchor", data)) end
if(xmlValue("shadowColor", data)~=nil)then self:setShadow(colors[xmlValue("shadowColor", data)]) end
if(xmlValue("border", data)~=nil)then self:setBorder(colors[xmlValue("border", data)]) end
if(xmlValue("borderLeft", data)~=nil)then borderColors["left"] = xmlValue("borderLeft", data) end
if(xmlValue("borderTop", data)~=nil)then borderColors["top"] = xmlValue("borderTop", data) end
if(xmlValue("borderRight", data)~=nil)then borderColors["right"] = xmlValue("borderRight", data) end
if(xmlValue("borderBottom", data)~=nil)then borderColors["bottom"] = xmlValue("borderBottom", data) end
if(xmlValue("borderLeft", data)~=nil)then borderColors["left"] = colors[xmlValue("borderLeft", data)] end
if(xmlValue("borderTop", data)~=nil)then borderColors["top"] = colors[xmlValue("borderTop", data)] end
if(xmlValue("borderRight", data)~=nil)then borderColors["right"] = colors[xmlValue("borderRight", data)] end
if(xmlValue("borderBottom", data)~=nil)then borderColors["bottom"] = colors[xmlValue("borderBottom", data)] end
if(xmlValue("borderColor", data)~=nil)then self:setBorder(colors[xmlValue("borderColor", data)]) end
if(xmlValue("ignoreOffset", data)~=nil)then if(xmlValue("ignoreOffset", data))then self:ignoreOffset(true) end end
if(xmlValue("onClick", data)~=nil)then self:generateXMLEventFunction(self.onClick, xmlValue("onClick", data)) end
Expand Down
9 changes: 5 additions & 4 deletions Basalt/objects/Textfield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ return function(name)
local objectType = "Textfield"
local hIndex, wIndex, textX, textY = 1, 1, 1, 1

local lines = { " " }
local lines = { "" }
local bgLines = { "" }
local fgLines = { "" }
local keyWords = { }
Expand Down Expand Up @@ -216,7 +216,7 @@ return function(name)
end;

clear = function(self)
lines = {" "}
lines = {""}
bgLines = {""}
fgLines = {""}
startSelX,endSelX,startSelY,endSelY = nil,nil,nil,nil
Expand Down Expand Up @@ -299,7 +299,7 @@ return function(name)
table.remove(bgLines, index or #bgLines)
table.remove(fgLines, index or #fgLines)
else
lines = {" "}
lines = {""}
bgLines = {""}
fgLines = {""}
end
Expand Down Expand Up @@ -720,6 +720,7 @@ return function(name)
self.parent:setBG(obx, oby + n - 1, bg)
self.parent:setFG(obx, oby + n - 1, fg)
end
--[[
if(startSelX~=nil)and(endSelX~=nil)and(startSelY~=nil)and(endSelY~=nil)then
local sx,ex,sy,ey = getSelectionCoordinates(self)
for n=sy,ey do
Expand All @@ -737,7 +738,7 @@ return function(name)
self.parent:setBG(obx + xOffset, oby + n - 1, rep(tHex[selectionBG], line))
self.parent:setFG(obx + xOffset, oby + n - 1, rep(tHex[selectionFG], line))
end
end
end]]
if(self:isFocused())then
local anchx, anchy = self:getAnchorPosition()
--self.parent:setCursor(true, anchx + textX - wIndex, anchy + textY - hIndex, self.fgColor)
Expand Down

0 comments on commit 6f0ddd6

Please sign in to comment.