![213894-scrollbug-widgettree.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/f/6/bf689b762479b593d7b1b1155e82986cabd1181f.png)
SETUP:
- In Blueprints creating a Scrollbox in a size box. It containing a uniform grid.
- The grid is populated with 9 simple custom widgets all in column 0.
- The blueprint holding all of this listens for DPAD up or DPAD down which decrements and increments a variable used to select one of the 9 custom widgets.
- After up or down is pressed and the index modified, ScrollWidgetIntoView() is called on the newly selected widget
WHAT HAPPENS:
Press down, when the next widget is cut off from the list, will properly scroll to the widget. Pressing up does not scroll.
EXPECTED:
Pressing up will scroll the selected widget into view in the same way it works when scrolling downward.
VARIATIONS:
- This happens whether called ScrollWidgetIntoView() is called from C++ or Blueprints.
- This happens whether “animation scroll” is true or false.
- This happens whether vertical or horizontal scrolling (and horizontal seems to introduce other issues.)
I have the same result after updating to 4.17. Scroll from top to down direction works perfectly, at up direction do not works. When i try again scroll down scroll not work. I think problem in detection of state of widget(in render zone/ not in render zone)
If this affects you, please vote up for visibility. ![:slight_smile: :slight_smile:](https://d1ap1mz92jnks1.cloudfront.net/images/emoji/twitter/slight_smile.png?v=12)
Seeing the exact same issue and my head hurts a bit looking at the code. Will have a look tomorrow and hopefully make a patch. ![:confused: :confused:](https://d1ap1mz92jnks1.cloudfront.net/images/emoji/twitter/confused.png?v=12)
Hello fxstronster,
I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.
Link: Unreal Engine Issues and Bug Tracker (UE-50084)
Make it a great day
Someone at Epic made some unorthodox math, here is a patch.
The file you want to change is Engine\Source\Runtime\Slate\Private\Widgets\Layout\SScrollBox.cpp
@@ -433,8 +433,9 @@
}
else
{
- const float WidgetStartPosition = GetScrollComponentFromVector(WidgetGeometry->Geometry.Position);
- const float WidgetEndPosition = GetScrollComponentFromVector(WidgetGeometry->Geometry.Position + WidgetGeometry->Geometry.GetLocalSize());
+ const FVector2D WidgetLocalPosition = MyGeometry.AbsoluteToLocal(WidgetGeometry->Geometry.GetAbsolutePosition());
+ const float WidgetStartPosition = GetScrollComponentFromVector(WidgetLocalPosition);
+ const float WidgetEndPosition = GetScrollComponentFromVector(WidgetLocalPosition + WidgetGeometry->Geometry.GetLocalSize());
const float ViewStartPosition = InScrollPadding;
const float ViewEndPosition = GetScrollComponentFromVector(MyGeometry.GetLocalSize() - InScrollPadding);
This is in UNIX patch format: scroll to line 433, remove lines with -
in front, add lines with +
Will make a PR on GitHub
Make it a great engine.