Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation for smoothScaleTo while zoom out #28

Closed
Tristus1er opened this issue Sep 19, 2013 · 2 comments
Closed

Animation for smoothScaleTo while zoom out #28

Tristus1er opened this issue Sep 19, 2013 · 2 comments

Comments

@Tristus1er
Copy link
Collaborator

When I use the function smoothScaleTo, the amimation is fine when I zoom in, but not good while zoom out (example zoom from 4 to 1).

In class ZoomPanLayout, it might be interesting to update the function smoothScaleTo that will check if the current scale (scale class variable ?) is less or greater than the destination parameter.
If it's greater, use as usual:

        tween.setDuration( duration );
        tween.start();

Else use another tween:

    private Tween tweenIn = new Tween();
    {
        tween.setAnimationEase( Strong.EaseIn );
        tween.addTweenListener( tweenListener );
    }

exemple:

    public void smoothScaleTo( double destination, int duration ) {
        if ( isTweening ) {
            return;
        }
        doubleTapDestinationScale = destination;

        if(scale > destination){
            tween.setDuration( duration );
            tween.start();
        }else{
            tweenIn.setDuration( duration );
            tweenIn.start();
        }
    }

I have tried, but I might have missed something as it doesn't work as expected :-/

@moagrius
Copy link
Owner

should this:

private Tween tweenIn = new Tween();
    {
        tween.setAnimationEase( Strong.EaseIn );
        tween.addTweenListener( tweenListener );
    }

be this:

private Tween tweenIn = new Tween();
    {
        tweenIn.setAnimationEase( Strong.EaseIn );
        tweenIn.addTweenListener( tweenListener );
    }

@moagrius
Copy link
Owner

was the above typo the source of the problem? can this issue be closed? if not, LMK if I can help...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants