- edited description
scrollBy() in MapContainer sets out of bounds scrollbar position indexes.
USE CASE: WHAT DO YOU WANT TO DO?
Scroll the matrix, either manually or by using a button / keyboard input.
STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)
-
Zoom into matrix.
-
Scroll to right or bottom edge.
CURRENT BEHAVIOR
Scrolling works by setting the scroll bar value in specific steps relative to the current scroll bar position. At the mentioned edge positions these steps will overshoot and the results are indexes that do not exist. For example for a 133x133 matrix, the maximum index is 132 but if the scrollbar already is at 131 further scrolling will attempt to add 3 indexes (step-size) and go to index 134.
The BufferedImage subImage() method will be affected by this, as scrolling also creates a new subImage.
The fault is in MapContainer.scrollBy()
EXPECTED BEHAVIOR
Scrolling will never lead to out-of-bound index calculation. The scrollBy method can never attempt to set anything beyond maxIndex.
DEVELOPERS ONLY SECTION
SUGGESTED CHANGE (Pseudocode optional)
Implement JUnit testing for scrollby(). Create viable bounds for scrollBy using maxIndex() and minIndex().
FILES AFFECTED (where the changes will be implemented) - developers only
MapContainer.java
LEVEL OF EFFORT - developers only
trivial
COMMENTS
Very likely causes #290 - test if this issue is resolved once the scrollBy() function is fixed.
Comments (11)
-
reporter -
- changed milestone to Navigation
-
reporter - marked as critical
Elevating this to critical since it breaks smooth user interaction with the matrix.
-
Not sure how much this has been worked on, but I just took a screen recording of what I think this issue might be causing. Either that or this is a completely separate bug:
https://dl.dropboxusercontent.com/u/87939936/BUGS/scrolling-white-screen-bug.mov
This was a screen recording of the recent layout test jar file.
-
reporter -
reporter - changed status to open
Beginning work on this issue which we have talked about in previous CCB meetings.
-
reporter - changed status to resolved
Final scrollBy() clean-ups and addition of JavaDoc
JavaDoc has been added to scrollBy(), some lines have been cleaned up to reduce clutter.
Resolves:
#299See also:
#270→ <<cset 1a66315eca72>>
-
reporter Final scrollBy() clean-ups and addition of JavaDoc
JavaDoc has been added to scrollBy(), some lines have been cleaned up to reduce clutter.
Resolves:
#299See also:
#270→ <<cset 1a66315eca72>>
-
- changed status to closed
Merged to master.
-
- changed component to Navigation
-
- removed milestone
Removing milestone: Navigation (automated comment)
- Log in to comment