Fix over scroll
Hi all
I have a bear-bones scroll set up that is over-scrolling past the last data button. Here is my code: Lua Code:
How do I solve the over-scrolling issue? |
Here's your code with some adjustments with a table of 50 entries to scroll through. See how buttonHeight (the height of a single row button) is used by FauxScrollFrame to calulate the offset of the thumb position in the bar and used in OnVerticalScroll to calculate back to an offset row in your data table for the update functions starting position.
I calculated the buttonHeight based on fitting 7 rows into the height of your ScrollFrame. I moved the frames to UIParent so, move the back where you want. Lua Code:
As an aside, FauxScrollFrame has been deprecated but I don't expect it will go away any time soon but you may want to consider updating or replacing the Faux... methods with your own at some point. |
Hi Fizzlemizz
Thanks for your code, it works perfectly; I will have to frankenstein it to meet my needs. When you say "You may want to consider updating or replacing the Faux... methods with your own at some point." how would I do such a thing? I am still a novice when it comes to coding. |
An example by MeoRaw on the new ScrollList interface that replaces FauxScroll and I believe HybridScroll can be found Here.
As I said, probably not an immediate need but something to keep in mind if the time comes. |
A page on making Scrollable Frames was added to the wiki yesterday. It doesn't have everything but will hopefully grow and improve over time.
|
Cool, quite different to how it worked before so will be handy to know it works now for when I may need it in the future.
|
All times are GMT -6. The time now is 09:40 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI