-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue with scrolling in item description #35766 #35929
Fix issue with scrolling in item description #35766 #35929
Conversation
Perhaps it's better to pass |
This is the reference. But I understood what you mean. I tried. This does not work. The function "draw_item_info" is also called without the parameter "selected" and it should equal zero. If the reference is zero, an exception will be thrown. Thus, the structure must store both parameters - the value "selected" and a link to it "ptr_selected". |
You can add a new signature of void draw_item_info( ... )
{
int selected = 0;
draw_item_info( ..., selected );
}
void draw_item_info( ..., int &selected )
{
// the actual implementation of draw_item_info
} And use it like this item_info_data data( ... );
draw_item_info( win, data );
// or draw_item_info( win, data, selected ); |
Then you need to change a lot of code in the files where the function "draw_item_info" is called. |
Well, having a struct contain a pointer to a value that is not managed by the struct itself could be dangerous. What if someone constructs |
You're right. But I can not figure out how to make it easier without lot code to be modified. Can you change the files yourself? |
Summary
SUMMARY: Bugfixes "Issue with scrolling in item description #35766"
Purpose of change
It fully resolves an issue: Fixes #35766
When scrolling the item description of an item with PgUp and PgDown, the scrolling now not get stuck.
Describe the solution
Scroll position now passed to "draw_item_info()" function by reference.
Testing
Tested in crafting menu, picking menu, compare menu and shift+V menu.