How the effects works ?
How the effects works ?
I'm trying to figure out how the effects (from ui/enchant) works.
At this point I need some explanations from people who have a deep
understanding of the enchant library code.
What I think I understood (for a simple effect like 'clip' for
example) :
We save some properties of the element on which we gonna apply the
effect,
& We show it (why ?),
We create a wrapper for the element (why ?),
We animate the element,
As soon as the animation is done, we restore the properties of the
element and we remove the wrapper.
I really want to know what is the use of the wrapper...
And I also see a big problem with the save & restore process on the
element : it "hardcode" computed style to the elements, overwriting
the real style of the element.
The problem is that, if I have an element with width and height in %,
after applying an effect to it, if I resize the parent, my element
wont resize as expected; and, depending of the effect, it could be the
same for the position (with top, left), the font-size, and so on...
Couldn't we use the save & restore process on the wrapper instead ?
Thank you for taking time to read my poor english : ),
lrbabe