From b98d3712ccb00689565af6a9a2f012dd18201aad Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 31 Mar 2010 07:25:53 -0400 Subject: [PATCH] In ListFrame:Update(): Only use information from self.scroll_bar if num_entries is greater than NUM_RECIPE_LINES. --- Frame.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Frame.lua b/Frame.lua index b0490a1..1139af1 100644 --- a/Frame.lua +++ b/Frame.lua @@ -3066,6 +3066,8 @@ do end return end + local offset = 0 + addon:ClosePopups() ARL_ExpandButton:SetNormalFontObject("GameFontNormalSmall") @@ -3074,15 +3076,15 @@ do if num_entries <= NUM_RECIPE_LINES then self.scroll_bar:Hide() else - self.scroll_bar:Show() + offset = self.scroll_bar:GetValue() + self.scroll_bar:SetMinMaxValues(0, math.max(0, num_entries - NUM_RECIPE_LINES)) + self.scroll_bar:Show() end self:ClearLines() local button_index = 1 - local string_index = button_index + self.scroll_bar:GetValue() - - self.scroll_bar:SetMinMaxValues(0, math.max(0, #self.entries - NUM_RECIPE_LINES)) + local string_index = button_index + offset -- Populate the buttons with new values while button_index <= NUM_RECIPE_LINES and string_index <= num_entries do @@ -3128,7 +3130,7 @@ do string_index = string_index + 1 end button_index = 1 - string_index = button_index + self.scroll_bar:GetValue() + string_index = button_index + offset -- This function could possibly have been called from a mouse click or by scrolling. -- Since, in those cases, the list entries have changed, the mouse is likely over a different entry - the highlight texture and tooltip should be generated for it. -- 1.7.9.5