Skip to content

Timer never fires under certain circumstances #5

@joneswah

Description

@joneswah

I found that computeScroll is indefinitely called under certain circumstances particularly when zoomed out, which means that the timer always is reset and never fires. So I needed to modify your computeScroll() method to check how many times it had been called and only reset it if it is under a specific limit.

private int computeScrollCount = 0;
private final static int MAX_SCROLL_COUNT = 25;

@Override
public void computeScroll()
{
    super.computeScroll();

    // Check for change
    if (isSpanChange() || isZoomChange())
    {
        if (computeScrollCount < MAX_SCROLL_COUNT) {
            // If computeScroll called before timer counts down we should drop it and 
            // start counter over again but dont let this occur indefinitely
            resetMapChangeTimer();
        }
        computeScrollCount++;
    }
}

then you need to reset the computeScrollCount=0 when the Timer fires.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions