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

strange behavior with opacity 0 #127

Closed
tinchox5 opened this issue Dec 8, 2015 · 10 comments
Closed

strange behavior with opacity 0 #127

tinchox5 opened this issue Dec 8, 2015 · 10 comments

Comments

@tinchox5
Copy link

tinchox5 commented Dec 8, 2015

Matt, I have this pen http://codepen.io/tinchox5/pen/YwPREE

I defined some tweens, one is called fadeIn and another fadeOut. FadeIn (opacity:1) works perfect, but fadeOut (opacity:0) isn't working when I use toggle().reverse() . I mean the opacity style doesnt change when I monitoring via browser inspector tool (chrome).

You can see the problem touching the circle situated at the top left main circle.

Is it a kind of bug or my fault?

@mattgperry
Copy link
Collaborator

I'll have to take a closer look when I'm back at a computer but my first guess is the first time the fadeIn animation fires it isn't going from '0' - you can force this by setting 'to' and 'current' explicitly on 'opacity' bit generally I just have one for fadeIn and one for fadeOut and call them both with 'start'

@tinchox5
Copy link
Author

tinchox5 commented Dec 8, 2015

You are right!
var fadeOut = new ui.Tween({
duration: 280,
values: {
opacity: {current:1, to:0} // works
}
});

var fadeOut = new ui.Tween({
duration: 280,
values: {
opacity: 0 // doesnt works
}
});

Thanks

@tinchox5
Copy link
Author

tinchox5 commented Dec 8, 2015

in addition, a want to change the border color, so I set borderColor both in Actor and Tween:
this is the error on console : TypeError: t.getPlayable is not a function (vs 4.2.4)

note: (also I tried use current and to, but not works). you can view this if uncomment line 58

@mattgperry
Copy link
Collaborator

I think this line is the problem:

ctrlcircle.toggle().reverse().then(ctrlcontact.toggle().reverse());

should be

ctrlcircle.toggle().reverse().then(function () {

ctrlcontact.toggle().reverse()
});

On Tue, 8 Dec 2015 at 23:37 Juan Martin notifications@github.com wrote:

in addition, a want to change the border color, so I set borderColor both
in Actor and Tween:
this is the error on console : TypeError: t.getPlayable is not a function
(vs 4.2.4)

note: (also I tried use current and to, but not works). you can view this
if uncomment line 58


Reply to this email directly or view it on GitHub
#127 (comment)
.

@tinchox5
Copy link
Author

tinchox5 commented Dec 9, 2015

Sorry Matt, when I do that, this is the error: Uncaught RangeError: Maximum call stack size exceeded

@mattgperry
Copy link
Collaborator

Ah I've found the source of this bug, I'll try to fix it today.

Thanks

@mattgperry
Copy link
Collaborator

@tinchox5 Should be fixed with 4.2.6

@tinchox5
Copy link
Author

tinchox5 commented Dec 9, 2015

Yeah thank you Matt! Also for add fillOpacity and strokeOpacity to svg role.

@tinchox5 tinchox5 closed this as completed Dec 9, 2015
@mattgperry
Copy link
Collaborator

@tinchox5 I saw another message somewhere but can't find it now about fillOpacity and strokeOpacity still not working but can't find it now. Try 4.2.7 - I misunderstood what was required. They were getting set as strokeOpacity when the format is stoke-opacity, now all properties will be reformatted to this.

Thanks for letting me know, it's been a real help ironing out bugs.

@yashsway
Copy link

Animating the opacity doesn't work in the latest release.

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

3 participants