|
|
|
Hm, other weird things happen when stretching a resource. I'll add another test case when I can repro.
OK, this is the bug that I'm really trying to fix. It appears that if you subsequently change the height of a stretched view with a resource from 0, the view will not accept any mouse events. Test case:
<canvas debug="true"> <view name="myview" height="0" stretches="height" resource="v_scroll_track.png" bgcolor="green" onclick="Debug.write('click', this)" onmouseover="Debug.write('mouseover', this)" onmouseout="Debug.write('mouseout', this)"/> <!-- After setting height to 200, the view gets no mouse events. --> <button x="100" text="set height to 200" onclick="myview.setHeight(200)" /> </canvas> r7933 | ptw | 2008-01-31 07:25:53 -0500 (Thu, 31 Jan 2008) | 34 lines
Changed paths: M /openlaszlo/trunk/WEB-INF/lps/lfc/debugger/platform/swf/LzDebug.as M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzMakeLoadSprite.as M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as Change 20080125-ptw-x by ptw@dueling-banjos.local on 2008-01-25 15:41:02 EST in /Users/ptw/OpenLaszlo/ringding-2 for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Yet another try at solving stretches vs. clickable Bugs Fixed: Technical Reviewer: hqm (message://<8c61fad60801301500w262fa19aq92cfcb6bd08011c@mail.gmail.com>) QA Reviewer: pkang (pending) Details: LzMakeLoadSprite: DON'T call updateResourceSize (which apparently papered over bugs in LzSprite, and now does the wrong thing). Don't inline parts of the code from LzSprite#set{Width,Height}, which leads to skew; call them. LzSprite: Add an informative debugging name. Added a bunch of devnotes to document the secret inner workings of the Flash player that Adam apparently thougth were patently obvious. Initialize resource{width,height}. Make sure you have a clip to scale before you try to scale it. Correct computation of scale for stretches when there is no resource supplied. Correct the computation for scaling of button (clickable) to compensate for the parent clip being stretched. Simplify computation of updateResourceSize. LzDebug: Make the movieclip debug printer more informative. Print _width and _height of movieclip when inpsecting. Tests: Test cases from (trunk 4 local build r7937)
1st example in bug: Runs successfully in swf and dhtml. 2nd example in bug: Runs successfully in swf and dhtml. WARNING: Due to limitations in the DHTML runtime, stretches will only apply to resources in this view, and doesn't affect child views. 3rd example in bug: Runs successfully in swf and dhtml. |
||||||||||||||||||||||||||||||||||||||||||||||||||||
<canvas debug="true">
<simplelayout axis="x" spacing="10"/>
<!-- Mouse over event -->
<view height="400" width="100" stretches="height"
bgcolor="silver"
onmouseover="Debug.write('mouseover')">
<view height="1" width="100" bgcolor="green"/>
</view>
<view height="400" width="100" stretches="height"
bgcolor="silver"
onmouseover="Debug.write('mouseover')">
<view height="2" width="100" bgcolor="red"/>
</view>
<!-- No mouse over event -->
<view height="400" width="100" stretches="height"
bgcolor="silver">
<view height="1" width="100" bgcolor="green"/>
</view>
<view height="400" width="100" stretches="height"
bgcolor="silver">
<view height="2" width="100" bgcolor="red"/>
</view>
</canvas>