mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Annotations update [5]
This commit is contained in:
@@ -51,7 +51,7 @@ function Blocker.on_input(self, action_id, action)
|
||||
return false
|
||||
end
|
||||
|
||||
if not self:is_enabled(self.node) then
|
||||
if not self:is_enabled() then
|
||||
return false
|
||||
end
|
||||
|
||||
|
@@ -621,8 +621,8 @@ function Scroll._check_points(self)
|
||||
|
||||
local temp_dist = math.huge
|
||||
local temp_dist_on_inert = math.huge
|
||||
local index = false
|
||||
local index_on_inert = false
|
||||
local index = -1
|
||||
local index_on_inert = -1
|
||||
local pos = self.position
|
||||
|
||||
for i = 1, #self.points do
|
||||
@@ -647,7 +647,11 @@ function Scroll._check_points(self)
|
||||
end
|
||||
end
|
||||
|
||||
self:scroll_to_index(index_on_inert or index)
|
||||
if index_on_inert >= 0 then
|
||||
self:scroll_to_index(index_on_inert)
|
||||
else
|
||||
self:scroll_to_index(index)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@@ -53,6 +53,9 @@
|
||||
--- Current text position
|
||||
-- @tfield vector3 pos
|
||||
|
||||
--- The last text value
|
||||
-- @tfield string last_value
|
||||
|
||||
--- Initial text node scale
|
||||
-- @tfield vector3 start_scale
|
||||
|
||||
@@ -320,6 +323,19 @@ function Text.set_to(self, set_to)
|
||||
end
|
||||
|
||||
|
||||
--- Set text area size
|
||||
-- @tparam Text self @{Text}
|
||||
-- @tparam vector3 size The new text area size
|
||||
-- @treturn Text Current text instance
|
||||
function Text.set_size(self, size)
|
||||
self.start_size = size
|
||||
self.text_area = vmath.vector3(size)
|
||||
self.text_area.x = self.text_area.x * self.start_scale.x
|
||||
self.text_area.y = self.text_area.y * self.start_scale.y
|
||||
update_adjust(self)
|
||||
end
|
||||
|
||||
|
||||
--- Set color
|
||||
-- @tparam Text self @{Text}
|
||||
-- @tparam vector4 color Color for node
|
||||
|
Reference in New Issue
Block a user