Input cursor fix
Fixed cursor for input objects when changing the value via :setValue()
This commit is contained in:
@@ -57,9 +57,9 @@ return function(name)
|
|||||||
setValue = function(self, val)
|
setValue = function(self, val)
|
||||||
base.setValue(self, tostring(val))
|
base.setValue(self, tostring(val))
|
||||||
if not (internalValueChange) then
|
if not (internalValueChange) then
|
||||||
if(self:isFocused())then
|
|
||||||
textX = tostring(val):len() + 1
|
textX = tostring(val):len() + 1
|
||||||
wIndex = math.max(1, textX-self:getWidth()+1)
|
wIndex = math.max(1, textX-self:getWidth()+1)
|
||||||
|
if(self:isFocused())then
|
||||||
local obx, oby = self:getAnchorPosition()
|
local obx, oby = self:getAnchorPosition()
|
||||||
self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self:getHeight()/2), self.fgColor)
|
self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self:getHeight()/2), self.fgColor)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user