diff --git a/Basalt/objects/Input.lua b/Basalt/objects/Input.lua index 06c68f6..8e23ce7 100644 --- a/Basalt/objects/Input.lua +++ b/Basalt/objects/Input.lua @@ -57,9 +57,9 @@ return function(name) setValue = function(self, val) base.setValue(self, tostring(val)) if not (internalValueChange) then + textX = tostring(val):len() + 1 + wIndex = math.max(1, textX-self:getWidth()+1) if(self:isFocused())then - textX = tostring(val):len() + 1 - wIndex = math.max(1, textX-self:getWidth()+1) local obx, oby = self:getAnchorPosition() self.parent:setCursor(true, obx + textX - wIndex, oby+math.floor(self:getHeight()/2), self.fgColor) end