Add a wrapper hbox around the rotating one, to stop glitches in the viewstack
authorAndy Allan <gravitystorm@gmail.com>
Tue, 25 Jan 2011 19:25:44 +0000 (19:25 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 25 Jan 2011 19:25:44 +0000 (19:25 +0000)
TODO.txt
net/systemeD/potlatch2/Toolbox.mxml

index 18d7ab3..3a8e61f 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -72,7 +72,6 @@ Potlatch 2: main outstanding issues
 * Doesn't look like a button
 * Clicking reverse doesn't update the toolbox (toolbox only recalculates itself on selection)
 * clockwise / anticlockwise are backwards
-* Click from area to line makes arrow displaced. click line again it sorts itself out.
 
 Requested enhancements
 ----------------------
index 5b90b3b..ab1c6d8 100644 (file)
 
         <mx:HBox width="28" height="28" y="4" x="36" borderStyle="solid" cornerRadius="4" click="reverseClicked();" horizontalAlign="center" verticalAlign="middle">
             <mx:ViewStack id="rotateButtonStack">
-                <!-- I can totally recommend adding borderStyle="solid" to arrowBox when debugging -->
-                <mx:HBox id="arrowBox" horizontalAlign="center" verticalAlign="middle" width="24" height="24">
-                    <mx:Image id="arrow" source="@Embed('../../../embedded/arrow.svg')"
-                        alpha="{getAlpha('reverseDirection')}"
-                        toolTip="Reverse direction (V)"
-                        width="22" height="22"/>
+                <mx:HBox id="arrowBoxWrapper"><!-- changing the viewstack back onto a rotated hbox causes positioning glitches, hence this wrapper -->
+                    <!-- I can totally recommend adding borderStyle="solid" to arrowBox when debugging -->
+                    <mx:HBox id="arrowBox" horizontalAlign="center" verticalAlign="middle" width="24" height="24">
+                        <mx:Image id="arrow" source="@Embed('../../../embedded/arrow.svg')"
+                            alpha="{getAlpha('reverseDirection')}"
+                            toolTip="Reverse direction (V)"
+                            width="22" height="22"/>
+                    </mx:HBox>
                 </mx:HBox>
                 <mx:HBox id="clockwiseBox" horizontalAlign="center" verticalAlign="middle">
                     <mx:Image id="clockwise" source="@Embed('../../../embedded/clockwise.svg')"
                         trace("clockwise?: "+w.clockwise);
                         w.clockwise? rotateButtonStack.selectedChild = clockwiseBox : rotateButtonStack.selectedChild = antiClockwiseBox;
                     } else {
-                        rotateButtonStack.selectedChild = arrowBox;
+                        rotateButtonStack.selectedChild = arrowBoxWrapper;
                         // reset and reposition back to the starting point relative to its parent
                         rotate.end();
                         angle = 0;
                         arrowBox.y = 0;
 
                         // move
-                        trace("angle: " + w.angle);
                         rotate.end();
                         angle = w.angle;
                         rotate.play();