Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-18775

BasicLayout: when element's left, top is negative number, size for its parent container isn't correct

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • Adobe Flex SDK Previous
    • None
    • Spark: BasicLayout
    • None
    • Affected OS(s): All OS Platforms
      Language Found: English

    Description

      Steps to reproduce:
      1. run following code:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo"
      minWidth="1024" minHeight="768" creationComplete="getSize()">
      <fx:Script>
      <![CDATA[
      public function getSize():void

      { output.text+="parentGroup.width="+parentGroup.width+";height="+parentGroup.height+"\n"; output.text+="parentGroup.pos="+parentGroup.x+";y="+parentGroup.y+"\n"; output.text+="childGroup.width="+childGroup.width+";height="+childGroup.height+"\n"; output.text+="childGroup.pos="+childGroup.x+";y="+childGroup.y+"\n"; output.text+="childBtn.pos="+childBtn.x+";y="+childBtn.y+"\n"; output.text+="childBtn.width="+childBtn.width+";height="+childBtn.height+"\n"; }

      ]]
      >
      </fx:Script>
      <s:Group id="parentGroup" >
      <s:Button id="parentBtn" label="parent" />
      <s:Group id="childGroup" >
      <s:layout>
      <s:BasicLayout/>
      </s:layout>
      <s:Button id="childBtn" label="child" left="-50" top="-10"/>
      <s:Rect id="childBorder">
      <s:stroke>
      <s:SolidColorStroke color="0x00FF00"/>
      </s:stroke>
      </s:Rect>
      </s:Group>
      <s:Rect id="border" left="0" right="0" top="0" bottom="0">
      <s:stroke>
      <s:SolidColorStroke color="0xFF0000"/>
      </s:stroke>
      </s:Rect>
      </s:Group>

      <mx:TextArea y="500" id="output" width="500" />
      </s:Application>

      2. check the size for childBtn and its parent container: childGroup
      3.

      Actual Results:
      parentGroup.width=70;height=21
      parentGroup.pos=0;y=0
      childGroup.width=20;height=11
      childGroup.pos=0;y=0
      childBtn.pos=-50;y=-10
      childBtn.width=70;height=21

      if childGroup should use maximum extents for its children, then it should use childBtn's size. Now it is smaller than its children.

      Expected Results:
      childGroup.width=70, childGroup.height=21

      Workaround (if any):

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: