From e8b180932146a85251edbd1be8042316b2f091f7 Mon Sep 17 00:00:00 2001 From: Insality Date: Sun, 14 Jun 2020 13:26:22 +0300 Subject: [PATCH] #74 typo fix strech -> stretch --- druid/base/scroll.lua | 12 ++++++------ druid/styles/default/style.lua | 2 +- example/page/scroll_page.lua | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/druid/base/scroll.lua b/druid/base/scroll.lua index 6577cbd..35ed50e 100644 --- a/druid/base/scroll.lua +++ b/druid/base/scroll.lua @@ -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 diff --git a/druid/styles/default/style.lua b/druid/styles/default/style.lua index 27248f5..61e5ee7 100644 --- a/druid/styles/default/style.lua +++ b/druid/styles/default/style.lua @@ -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, diff --git a/example/page/scroll_page.lua b/example/page/scroll_page.lua index f48ec74..1478b11 100644 --- a/example/page/scroll_page.lua +++ b/example/page/scroll_page.lua @@ -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