mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Prevent textinput.alltextselected from being set to true when the object contains no text
This commit is contained in:
parent
c674b46a0c
commit
eb4b5598f0
@ -355,7 +355,13 @@ function newobject:mousepressed(x, y, button)
|
||||
if not alltextselected then
|
||||
local lastclicktime = self.lastclicktime
|
||||
if (time > lastclicktime) and time < (lastclicktime + 0.25) then
|
||||
self.alltextselected = true
|
||||
if not self.multiline then
|
||||
if self.lines[1] ~= "" then
|
||||
self.alltextselected = true
|
||||
end
|
||||
else
|
||||
self.alltextselected = true
|
||||
end
|
||||
end
|
||||
else
|
||||
self.alltextselected = false
|
||||
@ -463,7 +469,13 @@ function newobject:keypressed(key, isrepeat)
|
||||
|
||||
if (loveframes.util.IsCtrlDown()) and focus then
|
||||
if key == "a" then
|
||||
self.alltextselected = true
|
||||
if not self.multiline then
|
||||
if self.lines[1] ~= "" then
|
||||
self.alltextselected = true
|
||||
end
|
||||
else
|
||||
self.alltextselected = true
|
||||
end
|
||||
elseif key == "c" and alltextselected then
|
||||
local text = self:GetText()
|
||||
local oncopy = self.OnCopy
|
||||
|
Loading…
Reference in New Issue
Block a user