#74 typo fix strech -> stretch

This commit is contained in:
Insality 2020-06-14 13:26:22 +03:00
parent 2ef288402e
commit e8b1809321
3 changed files with 8 additions and 8 deletions

View File

@ -290,7 +290,7 @@ local function update_size(self)
-- We add extra size only if scroll is available
-- Even the content zone size less than view zone size
local content_border_extra = helper.get_border(self.content_node)
local stretch_size = self.style.EXTRA_STRECH_SIZE
local stretch_size = self.style.EXTRA_STRETCH_SIZE
if self.drag.can_x then
local sign = content_size.x > view_size.x and 1 or -1
@ -325,11 +325,11 @@ end
-- @tfield[opt=20] number POINTS_DEADZONE Speed to check points of interests in no_inertion mode
-- @tfield[opt=0.35] number BACK_SPEED Scroll back returning lerp speed
-- @tfield[opt=0.2] number ANIM_SPEED Scroll gui.animation speed for scroll_to function
-- @tfield[opt=0] number EXTRA_STRECH_SIZE extra size in pixels outside of scroll (stretch effect)
-- @tfield[opt=0] number EXTRA_STRETCH_SIZE extra size in pixels outside of scroll (stretch effect)
-- @tfield[opt=false] bool SMALL_CONTENT_SCROLL If true, content node with size less than view node size can be scrolled
function M.on_style_change(self, style)
self.style = {}
self.style.EXTRA_STRECH_SIZE = style.EXTRA_STRECH_SIZE or 0
self.style.EXTRA_STRETCH_SIZE = style.EXTRA_STRETCH_SIZE or 0
self.style.ANIM_SPEED = style.ANIM_SPEED or 0.2
self.style.BACK_SPEED = style.BACK_SPEED or 0.35
@ -505,11 +505,11 @@ end
--- Set extra size for scroll stretching.
-- Set 0 to disable stretching effect
-- @function scroll:set_extra_strech_size
-- @function scroll:set_extra_stretch_size
-- @tparam[opt=0] number stretch_size Size in pixels of additional scroll area
-- @treturn druid.scroll Current scroll instance
function M.set_extra_strech_size(self, stretch_size)
self.style.EXTRA_STRECH_SIZE = stretch_size or 0
function M.set_extra_stretch_size(self, stretch_size)
self.style.EXTRA_STRETCH_SIZE = stretch_size or 0
update_size(self)
return self

View File

@ -63,7 +63,7 @@ M["scroll"] = {
FRICT_HOLD = 0.79, -- mult. for inert, while touching
INERT_THRESHOLD = 2.5, -- speed to stop inertion
INERT_SPEED = 30, -- koef. of inert speed
EXTRA_STRECH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect)
EXTRA_STRETCH_SIZE = 100, -- extra size in pixels outside of scroll (stretch effect)
POINTS_DEADZONE = 20, -- Speed to check points of interests in no_inertion mode
SCROLL_WHEEL_SPEED = 20,

View File

@ -54,7 +54,7 @@ function M.setup_page(self)
-- Content with less size than view
self.druid:new_scroll("scroll_smaller_view", "scroll_smaller_content")
:set_extra_strech_size(0)
:set_extra_stretch_size(0)
:set_inert(false)
-- Scroll with points of interests