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

Group not resizing correctly when contents are moved programmatically

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Adobe Flex SDK 4.1 (Release)
    • None
    • Spark: Group
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:

      I have created an application to illustrate the problem, we are in 4.1:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application
      minWidth="955" minHeight="600"
      xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx">

      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>

      <fx:Script>
      <![CDATA[
      import mx.controls.Alert;

      private function onGroupClick(event:MouseEvent):void

      { Alert.show("It works"); }

      private function onButtonClick(event:MouseEvent):void

      { rect.x += 500; rect.y += 500; }

      ]]
      >
      </fx:Script>

      <s:Scroller
      width="100%" height="100%">
      <s:Group id="myGroup"
      width="100%" height="100%"
      click="onGroupClick(event)">
      <s:Rect id="rect"
      x="0" y="0" width="10" height="10"/>
      </s:Group>
      </s:Scroller>
      <s:Button
      label="Move Rectangle"
      click="onButtonClick(event)"/>
      </s:Application>

      Steps to reproduce:

      1. Click anywhere in the screen - notice that an alert that reads "It works" shows up.
      2. Click on the "Move Rectangle" button enough times for the coordinates of the Rectangle to exceed the limits of the Scroller, hence producing scroll bars.
      3. Scroll all the way to the right and to the bottom.
      4. Click right next to the right bottom corner - notice that no alert is displayed. The reason is the Group has not resized correctly hence we are actually clicking outside the Group. Resizing your browser window for example will cause the Group to resize and events will again "work". FlexSpy will make things pretty apparent as well.

      Actual Results:
      The issue we are running into is when we programmatically move the contents of a Group which is in turn enclosed within a Scroller beyond the Scroller's limits the position of the Group within the stage is incorrectly calculated. This will cause mouseEvents in the area beyond the Group's limits to be "ignored" among other problems.

      Expected Results:
      The group is resized correctly when its contents change position.

      Workaround (if any):
      I have not found a work around that will fully solve the issue. Resetting a width will somewhat mitigate the issue but I can still see some mouse events not being dispatched.

      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: