From 69e38a497206942d5cf4112483ae0f9825b7d38b Mon Sep 17 00:00:00 2001 From: Kenny Shields Date: Fri, 24 Jan 2014 22:45:40 -0500 Subject: [PATCH] Update scrollarea position after initial calculations --- objects/internal/scrollable/scrollarea.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/objects/internal/scrollable/scrollarea.lua b/objects/internal/scrollable/scrollarea.lua index d221d8c..124420a 100644 --- a/objects/internal/scrollable/scrollarea.lua +++ b/objects/internal/scrollable/scrollarea.lua @@ -45,18 +45,9 @@ function newobject:update(dt) end end - local parent = self.parent - local base = loveframes.base - local update = self.Update - - -- move to parent if there is a parent - if parent ~= base then - self.x = parent.x + self.staticx - self.y = parent.y + self.staticy - end - self:CheckHover() + local base = loveframes.base local parent = self.parent local pinternals = parent.internals local button = pinternals[2] @@ -70,6 +61,7 @@ function newobject:update(dt) local internals = self.internals local bar = internals[1] local hover = self.hover + local update = self.Update if button then if bartype == "vertical" then @@ -85,6 +77,12 @@ function newobject:update(dt) end end + -- move to parent if there is a parent + if parent ~= base then + self.x = parent.x + self.staticx + self.y = parent.y + self.staticy + end + if down then if scrolldelay < time then self.scrolldelay = time + delayamount