Small Fix

- Fixed BaseFrame & Frames not setting correct cursor position, when there is a offset
This commit is contained in:
Robert Jelic
2023-05-06 14:46:44 +02:00
parent dda224bb53
commit e87557aba9
3 changed files with 6 additions and 4 deletions

View File

@@ -174,12 +174,13 @@ return function(name, basalt)
setCursor = function(self, _blink, _xCursor, _yCursor, color)
local obx, oby = self:getAbsolutePosition()
local xO, yO = self:getOffset()
cursorBlink = _blink or false
if (_xCursor ~= nil) then
xCursor = obx + _xCursor - 1
xCursor = obx + _xCursor - 1 - xO
end
if (_yCursor ~= nil) then
yCursor = oby + _yCursor - 1
yCursor = oby + _yCursor - 1 - yO
end
cursorColor = color or cursorColor
if (cursorBlink) then

View File

@@ -81,7 +81,8 @@ return function(name, basalt)
setCursor = function(self, blink, x, y, color)
local obx, oby = self:getPosition()
parent:setCursor(blink or false, (x or 0)+obx-1, (y or 0)+oby-1, color or colors.white)
local xO, yO = self:getOffset()
parent:setCursor(blink or false, (x or 0)+obx-1 - xO, (y or 0)+oby-1 - yO, color or colors.white)
return self
end,
}

View File

@@ -17,7 +17,7 @@ return function(name, basalt)
local defaultText = ""
local defaultBGCol = colors.black
local defaultFGCol = colors.white
local defaultFGCol = colors.lightGray
local showingText = defaultText
local internalValueChange = false