Skip to content

Commit 41b9db2

Browse files
committed
fix textlist issue, question mark.
clamp textList selector to ranges above 0 because in higher resolutions and or weird aspect ratios, the math can get screwy here (floor with negative and unsigned things and oh god please no)
1 parent 462bfbc commit 41b9db2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Interface/TextList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ void TextList::mouseOver(Action *action, State *state)
910910
if (_selectable)
911911
{
912912
int h = _font->getHeight() + _font->getSpacing();
913-
_selRow = _scroll + (int)floor(action->getRelativeYMouse() / (h * action->getYScale()));
913+
_selRow = std::max(0, (int)(_scroll + (int)floor(action->getRelativeYMouse() / (h * action->getYScale()))));
914914

915915
if (_selRow < _texts.size())
916916
{

0 commit comments

Comments
 (0)