Ordinastie / MalisisCore

MIT License
28 stars 35 forks source link

Fix scroll wheel issue. #149

Open Dockter opened 6 years ago

Dockter commented 6 years ago

Signed-off-by: Dockter dockter@almuramc.com

Barteks2x commented 6 years ago

The real issue is that the effective scroll step as seen by user depends on the content size. In my code I'm overriding scroll step to be:

    @Override
    public float getScrollStep() {
        float contentSize = getContentHeight() - getHeight();
        float scrollStep = super.getScrollStep() * 1000;
        float scrollFraction = scrollStep / contentSize;
        if (Float.isFinite(scrollFraction) && scrollFraction > 0) {
            return scrollFraction;
        }
        return 0;
    }

So this change will actually break my code (actually, it doesn't work with latest version anyway. But it's still not a backwards compatible change)