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

Key: LPP-4050
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: -- --
Assignee: Mamye Kratt
Reporter: André Bargull
Votes: 0
Watchers: 0
Operations

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

ChildView's width/height isn't reflected to the immediateparent (swf-only)

Created: 28/May/07 08:13 AM   Updated: 17/Jul/07 12:00 PM
Component/s: Kernel - swf6-8
Affects Version/s: 4.0.0, 4.0.2
Fix Version/s: 4.0.3

Time Tracking:
Not Specified

Severity: Major
Fixed in Change#: 5,388
Fixed in branch: branches/legals
Runtime: N/A
Flags: Regression
Fix in hand: False


 Description  « Hide
To see the proper output, you'd have to uncomment the setters for width/height.

Note:
If you set 'styleable="false"' or delete the "wrapping views" (foo & bar), you'll see the correct results.

[code]
<canvas debug="true" >
  
  <bluestyle name="bluecolors" isdefault="true" />
  
  <simplelayout axis="x" spacing="20" />
  
  <view name="foo" >
    <basecomponent width="100" height="100" styleable="true">
      <method name="_applystyle" args="s" >
        this.setAttribute( "bgcolor", s.bgcolor );
        //this.setWidth( this.width );
        //this.setHeight( this.height );
      </method>
    </basecomponent>
  </view>
  
  <view name="bar" >
    <view width="100" height="100" bgcolor="red" />
  </view>
</canvas>
[/code]

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Philip Romanik - 11/Jun/07 10:35 AM
This is a regression from 3.4.

Philip Romanik - 11/Jun/07 01:37 PM
This is a better example and it turns out to be a swf-only bug. The problem is inside LzSprite.as but I don't know what it is.

<canvas debug="true" >
  <simplelayout axis="x" spacing="20" />
   
  <view name="foo" >
    <view width="100" height="100">
      <method event="oninit">
        this.setAttribute( "bgcolor", 0xaaaaaa );
      </method>
    </view>
  </view>
   
  <view width="100" height="100" bgcolor="red" />
</canvas>


To make this demo work, you must set the background color in the view
(the only difference in this example is the bgcolor="blue" in the view tag)

<canvas debug="true" >
  <simplelayout axis="x" spacing="20" />
   
  <view name="foo" >
    <view width="100" height="100" bgcolor="blue">
      <method event="oninit">
        this.setAttribute( "bgcolor", 0xaaaaaa );
      </method>
    </view>
  </view>
   
  <view width="100" height="100" bgcolor="red" />
</canvas>

Max Carlson - 11/Jun/07 08:08 PM
Author: max
Date: 2007-06-11 20:07:37 -0700 (Mon, 11 Jun 2007)
New Revision: 5388

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
Log:
Change 20070611-maxcarlson-2 by maxcarlson@plastik on 2007-06-11 18:44:19 PDT
    in /Users/maxcarlson/openlaszlo/legals-clean
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Fix late bgcolor setting in swf

New Features:

Bugs Fixed: LPP-4050 - ChildView's width/height isn't reflected to the immediateparent (swf-only)

Technical Reviewer: promanik
QA Reviewer: jcrowley
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details: LzSprite.as - Ensure container resource is created when addChildSprite() is called.
    

Tests: Testcase from LPP-4050 now passes in swf



Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-06-12 02:13:16 UTC (rev 5387)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2007-06-12 03:07:37 UTC (rev 5388)
@@ -849,6 +849,7 @@
   */
 LzSprite.prototype.addChildSprite = function ( s ){
     if ( s.addedToParent ) return;
+ if ( ! this.__LZmovieClipRef ) { this.makeContainerResource() };
 
     s.addedToParent = true;
 }


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Mamye Kratt - 28/Jun/07 06:33 PM
(4.0 branch (4.0.3) local build r5544)
Testfiles run, same results in swf and dhtml.

Mamye Kratt - 28/Jun/07 06:34 PM
Need to test in legals.

Mamye Kratt - 17/Jul/07 12:00 PM
Need to test in legals.