About the Arithmetic in UX reactive expressions

Hi. A question about the Arithmetic in UX.

In version 0.31.0, I could offset a element by 20% by using Offset="(100/5)%,0".

After updating to latest version, the offset became 20 pixels instead of 20%.

I have tried to use Offset=“width(element)/5,0” to replace 100%, but it was quite unstable and failed in some situation so I would like to keep using 100%.

Any suggestion to fix it? Thank you for helping.

Version: 0.31.0 & 0.36.0

Local Preview with Macbook Pro.

<App>
<StackPanel ux:Name="panel" Height="70%" Width="100%" Color="#000">

	<Text Color="#fff"> Without Offset </Text>
	<Rectangle Alignment="Left" Color="#fff" Height="50" Width="50"/>

	<Text Color="#fff"> With Offset="20%,0" </Text>
	<Rectangle Alignment="Left" Color="#fff" Height="50" Width="50" Offset="20%,0"/>

	<Text Color="#fff"> With Offset="100%/5,0" </Text>
	<Rectangle Alignment="Left" Color="#fff" Height="50" Width="50" Offset="100%/5,0"/>

	<Text Color="#fff"> With Offset="(100/5)%,0" </Text>
	<Rectangle Alignment="Left" Color="#fff" Height="50" Width="50" Offset="(100/5)%,0"/>

	<Text Color="#fff"> With Offset="100/5,0" </Text>
	<Rectangle Alignment="Left" Color="#fff" Height="50" Width="50" Offset="100/5,0"/>

</StackPanel> 
</App>

Hi!

There might have been some slight differences in how expressions are parsed now compared to the first version that featured expressions. We’ll investigate it.

Hi!

This was indeed a bug, but applies only to vector expressions X, Y. A bugfix is on the way in the next release.

In the mean time you can solve it by setting X="100%/5" and Y="0" separately.

Thanks for reporting!

Thanks for your reply and suggestion!
I will try it out~