Skip to content

Commit

Permalink
PodLayoutManager: fixed slow layout bug when container resizes.
Browse files Browse the repository at this point in the history
Updated @author tags.

Change-Id: I8700b4b413d0fb180504cb89715d91176b7cba2c
  • Loading branch information
adufilie committed Oct 5, 2012
1 parent 7a72d21 commit 79e9d3f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
7 changes: 4 additions & 3 deletions WeaveUI/src/weave/ui/RTextEditor.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ RTextEditor
6. These columns become the input to the R script on the server, the server runs the script and returns the results.
7. On the client side, any returned Arrays are matched up with the original keys using the same row order to become columns.
8. Any other results are just printed out to the text area.
@spurushe
@sanbalag
-->
<!---
@author spurushe
@author sanbalag
-->
<DraggablePanel xmlns="weave.ui.*" xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalScrollPolicy="off" verticalScrollPolicy="off"
Expand Down
20 changes: 9 additions & 11 deletions WeaveUISpark/src/com/adobe/devnet/managers/PodLayoutManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public class PodLayoutManager extends EventDispatcher
private var itemHeight:Number; // Pod height.

private static const POD_GAP:Number = 4; // The vertical and horizontal gap between pods.
private static const TASKBAR_HEIGHT:Number = 25; // The height of the area for minimized pods.
private static const TASKBAR_HORIZONTAL_GAP:Number = 5; // The horizontal gap between minimized pods.
private static const TASKBAR_HEIGHT:Number = 24; // The height of the area for minimized pods.
private static const TASKBAR_HORIZONTAL_GAP:Number = 4; // The horizontal gap between minimized pods.
private static const TASKBAR_ITEM_WIDTH:Number = 150; // The preferred minimized pod width if there is available space.
private static const TASKBAR_PADDING_TOP:Number = 10; // The gap between the taskbar and the bottom of the last row of pods.
private static const PADDING_RIGHT:Number = 5; // The right padding within the container when laying out pods.
private static const TASKBAR_PADDING_TOP:Number = 4; // The gap between the taskbar and the bottom of the last row of pods.
private static const PADDING_RIGHT:Number = 0; // The right padding within the container when laying out pods.

// Removes null items from the items array.
// This should be called only once after all of the items have been added.
Expand All @@ -80,23 +80,21 @@ public class PodLayoutManager extends EventDispatcher

items = a;

// Weave: resize listener now in "set container"
//_container.addEventListener(ResizeEvent.RESIZE, updateLayout);
}

// Sets the canvas which will hold the pods.
public function set container(canvas:Group):void
{
_container = canvas;
// Weave: added this
_container.addEventListener(ResizeEvent.RESIZE, reSizeListener);
}
// Weave: this fixes slow update bug when container resizes
private function reSizeListener(event:ResizeEvent):void{
trace(container.width , container.height);
if (parallel != null && !parallel.isPlaying){
updateLayout();
}

/*if(!parallel || !parallel.isPlaying)
updateLayout();*/
updateLayout(false);
updateLayout(true);
}

public function get container():Group
Expand Down
4 changes: 1 addition & 3 deletions WeaveUISpark/src/weave/ui/WeavePodLayoutManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ package weave.ui
import weave.api.ui.ILinkableLayoutManager;

/**
* This is a basic implementation for ILinkableLayoutManager.
*
* @author adufilie
* @author sanbalag
*/
public class WeavePodLayoutManager extends Group implements ILinkableLayoutManager, IDisposableObject
{
Expand Down

0 comments on commit 79e9d3f

Please sign in to comment.