GSAP after clear timeline reverse animation not working - gsap

I am facing an issue when I clear the timeline using timeline.clear() to move back all the elements to it's original position because of immediateRenderer = true, now issue I am facing is after clear timeline revert is not working.
Please suggest a proper solution that includes immediateRenderer to true with on complete of animation elements should reset to it's original position and revert should work after clear the timeline
I have also search into GSAP forum but not get any proper solution for this issue.

When you clear() a timeline, that literally deletes all of its child animations, so it'd make sense that if you try to revert by doing something like seek(0), it would have no effect (there are no child tweens to re-render at their staring values). It sounds like maybe you just shouldn't call clear() before reverting.
If your goal is to revert the changes that a tween or timeline made, you should be able to simply seek(0) to jump back to the starting time, and if you want to pause it there so that it doesn't continue playing just pause(0) like:
var tl = new TimelineLite();
tl.to(...);
//then later...
tl.pause(0);
Is that what you're looking for?
If not, it'd be super helpful if you could provide a reduced test case in codepen or jsfiddle so that we can see what's going on.
Also, were you saying that you posted in the GreenSock forums but you didn't receive an answer? We're usually very good about answering every question, typically in less than 24 hours. Let me know if there's something we missed.

Related

wxGrid - RefreshBlock Undocumented Member Function

In order to refresh a part of the grid, i.e., when font or alignment changes, I was using the following approach:
wxRect rect1=CellToRect(TopLeft);
wxRect rect2=CellToRect(BottomRight);
wxRect r(rect1.GetTopLeft(), rect2.GetBottomRight());
RefreshRect(r);
This was refreshing only a part of the intended block and was not working correctly.
From the suggestions of intellisense I came across RefreshBlock function and it works correctly. I searched the docs and have not found any information on it. I wonder if it is not recommended to use RefreshBlock for some reason? What does RefreshBlock do, does it refresh a block (as the name suggests) or is it equivalent to Refresh?
I am using wxWidgets 3.2 on Win10.
Thanks in advance.
The function RefreshBlock() is indeed the best way to do what you want and it was only undocumented by mistake, i.e. we simply forgot to do it. I've added documentation for it only now, so it will only get included in 3.2.1, but you can still use it in your code, the function itself is available since 3.1.3.
It seems from the source code that, depending on the location of its parameters, RefreshBlock refreshes any of the following:
corner grid
frozen cols grid
frozen rows grid
main grid
Since the area I wanted to refresh was on the main grid the following approach works (the idea is similar to RefreshBlock's approach):
auto GridWnd = CellToGridWindow(TL);
wxRect rect = BlockToDeviceRect(TL, BR, GridWnd);
GetGridWindow()->RefreshRect(rect);
Now everything is refreshed correctly.
Notes:
If only RefreshRect(rect) is called, things will NOT work as expected.
Little experiment showed that BlockToDeviceRect(TL, BR) also works, therefore eliminating the need for auto GridWnd = CellToGridWindow(TL);

Reverting to original state GSAP - TweenlineMax

I was looking through GSAP documentation and couldn't find a way to revert an animation to it's original state without going throught the whole reversed cycle. Basicly I want to Tween an element and after it ends I want it to jump back to it's original state without animation. Is there any good practice on how to do this?
Sure, there are tons of ways:
timeline.seek(0).pause(); //jumps to the 0 position and then pauses
timeline.pause(0); //shortcut for the line above
timeline.progress(0).pause();
timeline.totalProgress(0).pause();
timeline.restart(0).pause();
(any single line above will do)
And "timeline" above is a reference to your TimelineMax instance. (you said "TweenlineMax" but I'm sure you meant TimelineMax).
Happy tweening!

Renderer stops working when inserting specific code into function! three.js

I would like to start off by mentioning that I am very new to coding, so some things that might seem very simple to someone with intermediate experience will probably not click quite as fast with me.
Okay so with the code I am writing, I am trying to get a three.js cube object to move to the places I click, using tweening. I managed to get this to work, but when I try to create a frame using three.js lines, the code stops working. In detail: when I add
line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial() );
scene.addObject( line );
to the Init() function. What is cause of this? My guess is it has something to do with global/local variables but even if that were correct I have no idea how to fix it !
This is the jsfiddle for reference

dojo.dnd.move node rendering issue

Dojo has a basic issue, amongst other things... with its dojo.dnd.move class. The issue which you can see here:
http://archive.dojotoolkit.org/nightly/dojotoolkit/dojo/tests/dnd/test_parent_constraints.html
Is that when you click on a node, and start dragging, the node itself jumps. It actually moves its position. This is extremely problematic and I was wondering if anyone has seen this happen before.
I am creating an application that requires the moving of nodes but it needs to be precise and thus can't have the initial jump.
Any help would be greatly appreciated.
This is caused by the following highlighted code in Mover.js:
https://github.com/dojo/dojo/blob/master/dnd/Mover.js#L91-92
The odd thing is, based on the comments, it seems like this code is causing the very problem it aims to prevent.
That said, if your body has padding: 0 applied to its style, this code shouldn't affect you. (You can test it on that test page by running document.body.style.padding = "0" in the console before dragging.)
You might want to enter a ticket on the Dojo bug tracker at http://bugs.dojotoolkit.org (or maybe search and see if one has already been entered for it).

Simulate "Slide to Unlock" in MobileSubstrate

There is a way to simulate the Slide To Unlock in the lockscreen? I've been looked for this in SBAwayController, but without any results :( Have anyone an idea?
I believe (if I understand your question correctly) you want to have the lockbar "unlock itself". For something like that you want to look into SBAwayView, not SBAwayController. In that class there are different methods that interact with the different lockbars. You will want to specifically look at the SBAwayLockBar which is a sublcass of TPBottomLockBar (defined in <TelephonyUI/TPBottomLockBar.h>)
You will have to poke around in the headers and see if there is any way to access the lockbar's Knob position.
Hope that helped at least a bit.