Running Fuse 0.30.0 on El Capitan.
I think there are a couple of issues regarding how LayoutAnimation
s are performed on elements or targets that have been rotated.
Here’s a stripped down version of what I’m trying to achieve, with three issues I’ve found, followed by the code.
I’ve got a pink box for which I’m changing the LayoutMaster
expecting the box to move to either the green or purple “targets” as seen below. When I rotate the panel containing the green and purple targets, essentially flipping the two, I’d expect the LayoutMaster
change to still recognize the new positions of those targets and move my pink box to the right place.
Issue #1
If I rotate the panel containing my green and purple targets, the layout positioning seems to be screwed up (translated by width and height, it seems), as seen below.
Issue #2
If I set the LayoutMaster
to, say, purple, but then rotate the panel containing my green and purple targets, and then try to set the LayoutMaster
to purple (which is now in a different position), it doesn’t seem to recognize that it needs to move. Once I set LayoutMaster
to green, things are back on track (with the exception of the positioning issue described above).
Issue #3
If I rotate the pink panel and then set the LayoutMaster
to green or purple, it seems to move in from off-screen rather than the current location of the panel.
Code
Note: I’ve tried with both <Move RelativeTo="WorldPositionChange"...
and <Move RelativeTo="LayoutChange"...
with the same result.
<App>
<Panel ux:Class="Button" Padding="5">
<string ux:Property="Text" />
<Rectangle Layer="Background" CornerRadius="5">
<Stroke ux:Name="stroke" Width="1" Color="#000"/>
</Rectangle>
<Text Alignment="Center" Value="{Property Text}" />
<WhilePressed>
<Change stroke.Color="#f00" Duration="0.2"/>
</WhilePressed>
</Panel>
<Panel>
<Panel Width="40" Height="40" ux:Name="outpanel" Color="#fab">
<LayoutAnimation>
<Move RelativeTo="WorldPositionChange" X="1" Y="1" Duration="0.3" Easing="CubicInOut" />
</LayoutAnimation>
<Text Alignment="Center" Value="Test" />
<Rotation ux:Name="rotation" />
</Panel>
<StackPanel>
<Panel Height="150">
<Rotation ux:Name="panelRotation" />
<Panel ux:Name="target1" Margin="50" Width="50" Height="50" Alignment="Left" Background="#5f5" />
<Panel ux:Name="target2" Margin="50" Width="50" Height="50" Alignment="Right" Background="#55f" />
</Panel>
<StackPanel Alignment="Center" ItemSpacing="20" Height="50%" Orientation="Horizontal">
<StackPanel ItemSpacing="10">
<Button Text="Green">
<Clicked>
<Set outpanel.LayoutMaster="target1" />
</Clicked>
</Button>
<Button Text="Purple">
<Clicked>
<Set outpanel.LayoutMaster="target2" />
</Clicked>
</Button>
</StackPanel>
<StackPanel ItemSpacing="10">
<Button Text="Rotate Targets">
<Clicked>
<Set panelRotation.Degrees="180" />
</Clicked>
</Button>
<Button Text="Rotate Targets Back">
<Clicked>
<Set panelRotation.Degrees="0" />
</Clicked>
</Button>
</StackPanel>
<StackPanel ItemSpacing="10">
<Button Text="Rotate Panel">
<Clicked>
<Set rotation.Degrees="180" />
</Clicked>
</Button>
<Button Text="Rotate Panel Back">
<Clicked>
<Set rotation.Degrees="0" />
</Clicked>
</Button>
</StackPanel>
</StackPanel>
</StackPanel>
</Panel>
</App>