AvaloniaUI/Avalonia

Transitions not working on Browser

Opened this issue · 1 comments

Describe the bug

In a program I want to use Transitions. If I select the Desktop project to run and run the program, everything is displayed very well and I have no problem running Transitions.
If I select the Browser project and try to debug the project with Visual Studio, there is still no problem and Transitions run well.
But if I run the Browser project with the dotnet run command and through the Terminal, it gives me this error when running:

{
  "ClassName": "System.FormatException",
  "Message": "Invalid unit: −691px",
  "Data": null,
  "InnerException": null,
  "HelpURL": null,
  "StackTraceString": "   at Avalonia.Media.Transformation.TransformParser.ParseUnit(ReadOnlySpan`1& part)\n   at Avalonia.Media.Transformation.TransformParser.<ParseFunction>g__ParseValue|3_0(ReadOnlySpan`1 part)\n   at Avalonia.Media.Transformation.TransformParser.<ParseFunction>g__ParseValuePair|3_1(ReadOnlySpan`1& part, UnitValue& leftValue, UnitValue& rightValue)\n   at Avalonia.Media.Transformation.TransformParser.ParseFunction(ReadOnlySpan`1& functionPart, TransformFunction function, Builder& builder)\n   at Avalonia.Media.Transformation.TransformParser.Parse(String s)\n   at Avalonia.Media.Transformation.TransformOperations.Parse(String s)\n   at ExperimentReader.Models.AnimateData.RunMovementAnimation(ElementBase element) in D:\\Programming\\Projects\\AzmoonKhan_Web_Avalonia\\ExperimentReader\\Models\\AnimateData.cs:line 192",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": null,
  "HResult": -2146233033,
  "Source": "Avalonia.Base",
  "WatsonBuckets": null
}

And again, if I publish the Browser project and put it on the server or if I try to run the site locally by executing the dotnet serve command in the Terminal, it still gives me this error.
After a while, I realized that the value "-691px" that it is having problems with includes the character "u+200e" and so I removed the character "u+200e" from the string, but it still gives me the same error as before.

image

How can I fix this problem? If the problem is with the browser, then when I debug the program with Visual Studio it should give me this error, but I don't see anything like that. Please help me.

To Reproduce

  • Create a new Style for UserControl
  • Definition of Setters
  • Adding RenderTransformProperty to Setters
  • Store a string containing translate in the RenderTransformProperty
  • Run the Browser project
  • Error

Expected behavior

Animations run smoothly

Avalonia version

11.2.2

OS

Windows

Additional context

No response

Store a string containing translate in the RenderTransformProperty

You can create these with TransformOperations.CreateBuilder() API. No need to parse anything in runtime.

Run the Browser project

Wasn't able to reproduce with similar code.