Max has warned me about this use of this.animate(...) because it  
creates a new animator each time it is called. The code snipped below  
looks like it's creating four animators each time the focus changes.  
Refactoring to re-use the same four animators for these four  
attributes each time the focus changes might avoid an unnecessary  
performance hit.

-ben

On Oct 6, 2006, at 11:17 AM, Philip Romanik wrote:

> Hi Tucker,
>
> I agree. To make my problems go away, I changed setHeight() and  
> setWidth()
> in LzSprite.js. But there are a lot of issues like this. When I  
> work around
> one issue I get to another one.
>
> This is what the code in basefocusview.lzx looks like (I edited  
> this a bit):
>
> nx = v.getAttributeRelative('x', canvas);
> ny = v.getAttributeRelative('y', canvas);
> nw = v.getAttributeRelative( 'width', canvas );
> nh = v.getAttributeRelative( 'height', canvas );
>
> this.animate( 'x', nx, duration);
> this.animate( 'y', ny, duration);
> this.animate( 'width', nw, duration);
> this.animate( 'height',nh , duration);
>
>
>
>> Ok, this is soluble.
>>
>> All setting of CSS attributes should be through LzSprite.  LzSprite
>> has to convert LFC numbers using CSSDimension (q.v.) because CSS
>> dimensions are strings and must have units (unless they are 0).
>> CSSDimension could be conditionalized for browsers using the Jim/Max
>> capability scheme.  And it can turn NaN back to undefined or null or
>> 0 or whatever makes i.e., happy.
>>
>> Of course, we probably should not be wasting time animating undefined
>> properties, either.
>
>
> _______________________________________________
> Laszlo-dev mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev


_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to