question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animations of controls inside viewbox when scaled up are jagged

See original GitHub issue

I have a window with a content like this:

<Viewbox>
	<Grid Width="30" Height="30">
		<Rectangle Stroke="Black" StrokeThickness="1" Fill="Red" Width="10" Height="10"/>
	</Grid>
</Viewbox>

The code behind has this method:

private void Rectangle_Tapped (object sender, Avalonia.Interactivity.RoutedEventArgs e)
{
	Animation anim = new Animation()
	{
		Duration = TimeSpan.FromSeconds(20d),
		Children = {
			new KeyFrame()
			{
				Cue = new Cue(0d),
				Setters = {
					new Setter { Property = WidthProperty, Value = 10d }
				}
			},
			new KeyFrame()
			{
				Cue = new Cue(1d),
				Setters = {
					new Setter{ Property = WidthProperty, Value = 30d }
				}
			}
		}
	};
	anim.Apply((Animatable) ((Grid) ((Viewbox) Content).Child).Children[0], null, Observable.Return(true), null);
}

The constructor has this line: ((Rectangle) ((Grid) ((Viewbox) Content).Child).Children[0]).Tapped += Rectangle_Tapped; This is the output: output

@jmacato

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jmacatocommented, Aug 27, 2020

AFAIK, I can’t register pseudo-classes.

You could add/remove classes with the “Classes” property btw 😃 so you can have a certain class removed/added on codebehind then set your animation in styles

0reactions
VoNguyenMinhTrietcommented, Aug 28, 2020

Thanks for the reply! But it’s off topic I guess…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animated viewBox - transform scale is blury · Issue #1451
My issue is that whenever I animate my svg with a transform function it ends up being blury when I zoom in. The...
Read more >
A Deep Dive Into The Wonderful World Of SVG ...
SVG feDisplacement filter: how to deal with jagged edges · Don't Give Up On Webkit! · Creating SVG Displacement Maps And Getting Them...
Read more >
RoutedEventArgs Class - Typedescriptor
InvalidOperationException: The control already has a visual parent. #4839 ... Animations of controls inside viewbox when scaled up are jagged #4563.
Read more >
Animated SVG vs GIF [CAGEMATCH]
An SVG image will look super crisp on any screen resolution, no matter how much you scale it up. Whereas GIFs—a raster image...
Read more >
Let's Learn Blender! #5: Smoothing & Hard Edges - YouTube
... Tutorial Summary - 35:13 - Video Wrap- Up, Social Media, & Call to Action *Don't for get to click LIKE & SUBSCRIBE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found