diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md old mode 100644 new mode 100755 diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md old mode 100644 new mode 100755 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md old mode 100644 new mode 100755 diff --git a/CHANGELOG.md b/CHANGELOG.md index da04033..45ccfd3 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * Fix text processing pipeline (#70) +* Fix jittery animations (#71) ## 1.1.0 (2020-08-24) diff --git a/Glass/Modules/SlidingMessageFrame.lua b/Glass/Modules/SlidingMessageFrame.lua index 2a4e351..af5e621 100755 --- a/Glass/Modules/SlidingMessageFrame.lua +++ b/Glass/Modules/SlidingMessageFrame.lua @@ -69,6 +69,9 @@ function SlidingMessageFrame:Initialize() self.scrollFrame:SetWidth(self.config.width) self.scrollFrame:SetPoint("BOTTOMLEFT", 0, self.config.overflowHeight * -1) + -- Set initial scroll position + self.scrollFrame:SetVerticalScroll(self.config.overflowHeight) + self.scrollFrame.bg = self.scrollFrame:CreateTexture(nil, "BACKGROUND") self.scrollFrame.bg:SetAllPoints() self.scrollFrame.bg:SetColorTexture(0, 1, 0, 0) @@ -113,9 +116,6 @@ function SlidingMessageFrame:Initialize() -- Initialize slide up animations self.sliderAg = self.slider:CreateAnimationGroup() - self.sliderStartOffset = self.sliderAg:CreateAnimation("Translation") - self.sliderStartOffset:SetDuration(0) - self.sliderTranslateUp = self.sliderAg:CreateAnimation("Translation") self.sliderTranslateUp:SetDuration(0.3) self.sliderTranslateUp:SetSmoothing("OUT") @@ -396,19 +396,19 @@ function SlidingMessageFrame:Update() local newHeight = self.slider:GetHeight() + offset self.slider:SetHeight(newHeight) - self.sliderStartOffset:SetOffset(0, offset * -1) self.sliderTranslateUp:SetOffset(0, offset) -- Display and run everything - self.scrollFrame:SetVerticalScroll(newHeight - self.scrollFrame:GetHeight() + self.config.overflowHeight) + self.sliderAg:SetScript("OnFinished", function () + self.scrollFrame:SetVerticalScroll(newHeight - self.scrollFrame:GetHeight() + self.config.overflowHeight) + end) + self.sliderAg:Play() for _, messageFrame in ipairs(newMessages) do messageFrame:Show() table.insert(self.state.messages, messageFrame) end - self.sliderAg:Play() - -- Release old messages local historyLimit = 128 if #self.state.messages > historyLimit then