Opened 11 years ago
Closed 10 years ago
#2101 closed defect (fixed)
[PATCH] Erroneous data sent to scrollbar code.
Reported by: | Josh | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 15 |
Component: | Core engine | Keywords: | patch |
Cc: | sanderd17 | Patch: |
Description (last modified by )
Steps to reproduce:
- Make sure you have no demo maps
- Open the single-player gamesetup screen
- Set the filters to show the empty list of demo maps
- Change the filters
- View warnings
I tried to find the source of the issues, and it seems that some piece of code is setting the area available to the scrollbar to a negative number through SetLength which should never happen.
Here are the places that call that function:
gui/CList.cpp
151: GetScrollBar(0).SetLength( rect.bottom - rect.top );
gui/COList.cpp
97: GetScrollBar(0).SetLength( rect.bottom - rect.top );
gui/CInput.cpp
719: GetScrollBar(0).SetLength(m_CachedActualSize.bottom - m_CachedActualSize.top);
749: GetScrollBar(0).SetLength(0.f);
753: GetScrollBar(0).SetLength( m_CachedActualSize.bottom - m_CachedActualSize.top );
952: GetScrollBar(0).SetLength( m_CachedActualSize.bottom - m_CachedActualSize.top );
993: GetScrollBar(0).SetLength(m_CachedActualSize.bottom - m_CachedActualSize.top);
gui/CText.cpp
123: GetScrollBar(0).SetLength(m_CachedActualSize.bottom - m_CachedActualSize.top);
179: GetScrollBar(0).SetLength( m_CachedActualSize.bottom - m_CachedActualSize.top );
Alright, it appears the problem is in gui/CList.cpp
Attachments (1)
Change History (13)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
I think this is different, the errors here are:
WARNING: Minimum scrollbar size of 4 is larger than the total scrollbar size of -24
comment:5 by , 11 years ago
I believe Josh added the warning to show when faulty data is being send. It looks like the faulty data has been in for a very long time, but it's only visible now thanks to r13773.
comment:6 by , 11 years ago
Replying to historic_bruno:
This isn't reproducible for me if r13773 is reverted.
My changes also added some warnings if the data to some stuff was totally wrong. This was intended to help debug issues when working with the moddable GUI code, but apparently some of the existing C++ code is calculating non-sensible data that had been ignored before but now is warned about. One option would be just removing the warning and hoping the code keeps working, but that is really hacky and should be avoided. The best solution would most likely just be fixing the original bug (not even mentioning that fixing the original bug should be really easy once we identify the source).
If someone could figure out where the bad calculation originates, I would happily try to fix it.
comment:7 by , 11 years ago
Description: | modified (diff) |
---|
comment:8 by , 11 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 15 |
Summary: | Erroneous data sent to scrollbar code. → [PATCH] Erroneous data sent to scrollbar code. |
comment:9 by , 11 years ago
Actually, on further thought, there are valid situations during normal use where the scrollbar length could be zero (Example: Make window smaller than the smallest default resolution). So I think it would be best to remove the warning.
comment:11 by , 11 years ago
Keywords: | review removed |
---|
comment:12 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Pretty sure this is fixed now since the lobby fork has been merged and I can't reproduce the issue.
This looks the same issue of #2071.