How is resourcewidth/height calculated in the compiler? Does the
compiler just take the first frame and measure its content, or does it
use the maximum bounds of all frames?
+ // If compiler supplied the asset's width and height, use those values
+ if (res.width != null) {
+ this.resourcewidth = Math.round(res.width);
+ }
+ if (res.height != null) {
+ this.resourceheight = Math.round(res.height);
+ }
resource{width, height} should be set to 0 if not defined. Otherwise
applyStretchResource() may use stale values.
+ __setFrame(1);
Just as you've noticed, __resetframe() may be called multiple times
while the asset is still loading. In that case, calling __setFrame()
enqueues another callback for __resetframe(). But that means you must
not call __setFrame(1), otherwise LzSprite#frame is set to a wrong value.
+ var res = getAsset(this.resource, frame);
+ resourcewidth = res.width;
+ resourceheight = res.height;
I'm not sure how resource{width, height} is calculated in the compiler.
this.stop(this.frame);
+ applyStretchResource();
+ sendResourceLoad(true);
stop() calls __setFrame() which in turn calls applyStretchResource() (if
the asset is loaded), so the extra call for applyStretchResource()
shouldn't be necessary.
And sendResourceLoad() should only be called once for every resource,
not for every frame of a multiframe resource.
On 8/11/2010 5:42 PM, Henry Minsky wrote:
Andre, could you take a look at this change? I only seem to be able to get the
correct width/height from the
asset if I call setFrame from _resetframe, which schedules a *second* call to
__resetframe. On the second call,
the asset seems to have width and height correct.
Change 20100811-hqm-R by [email protected] on 2010-08-11 10:42:57 EDT
in /Users/hqm/openlaszlo/trunk2
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: swf10: "stretches" attribute doesn't work for embedded swf resources
New Features:
Bugs Fixed: LPP-9286
Technical Reviewer: andre
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Details:
check the actual loaded resource width/height in __resetframe
Tests:
test case from bug report
lzpix demo ins swf10
Files:
M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100811-hqm-R.tar