History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5372
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Pablo Kang
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Mouse events available for first 100 pixels on a stretched view

Created: 22/Jan/08 06:58 PM   Updated: 31/Jan/08 02:30 PM
Component/s: Laszlo Foundation Classes (LFC)
Affects Version/s: 4.0.5WaffleCone
Fix Version/s: RingDing (4.1)

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 7,933
Runtime: N/A
Fix in hand: False


 Description  « Hide
Stretched view only accept mouse events on the first 100 pixels. Test case:

<canvas debug="true">

    <!-- Mouse events only over first 100 pixels of gray rectangle; green bar
         represents 100 pixels. -->
    <view height="400" width="100" stretches="height"
          bgcolor="silver"
          onclick="Debug.write('click')"
          onmouseover="Debug.write('mouseover')"
          onmouseout="Debug.write('mouseout')" />

    <!-- Bar representing 100 pixels -->
    <view x="110" height="100" width="10" bgcolor="green" />

</canvas>


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Pablo Kang - 22/Jan/08 07:06 PM
More weirdness. If I add a subview to a stretched view, I get different results on how that subview is displayed depending on whether a mouse event is defined or not. Can anyone explain what's happening here?

<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>

P T Withington - 23/Jan/08 10:45 AM
Probably related to LPP-3726, LPP-4661, LPP-4684

Pablo Kang - 23/Jan/08 10:54 AM
Hm, other weird things happen when stretching a resource. I'll add another test case when I can repro.

Pablo Kang - 23/Jan/08 11:00 AM
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>

P T Withington - 31/Jan/08 04:27 AM
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:
LPP-5372 'Mouse events available for first 100 pixels on a stretched view'

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 LPP-5372, 4661 (original and one in comments), 3726


Mamye Kratt - 31/Jan/08 02:30 PM
(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.