Animation is "smoother" when zoomed in or out

I noticed that if you have several items animated on a screen (ie several spinning fan graphics) the animation gets “jumpy”. However I noticed that viewing the screen at any zoom level other than 100% seems to make the animation of such graphics “smoother”.

This is easily reproduced by plopping about 20 rectangles with the angle property bound to the value property of a signal generator. 100% zoom shows the animation to be a bit “jumpy”, but zooming in or out causes the animation to be observably smoother.

I tried this out - it all looked the same to me…

I’m guessing this might be tied to memory/cpu capability of the machine running the designer.

I’ve attached a screen which is exhibiting the issues for me (in 7.4.2). At 100% zoom level the animation on the screen is jumpy and not smooth. Zoom to any other level and the animation looks a lot smoother.
SSCCE_Main Window_2012-05-15_1543.proj (20 KB)

Phew, that was a weird one. Your test case did replicate the issue on my machine, and I tracked down the reason. Turns out having a bunch of independently repainting rectangles is fairly inefficient in normal swing. We have a special repaint manager installed that behaves differently when zoomed in or out. Normally, this different behavior hurts painting performance, but in this case it actually helps it, a lot, by consolidating the paint requests into one.

Not sure what we can do about this one, but I’ve created a ticket to try and improve it.

Cool, I just noticed the behavior with screen with a bunch of animated objects and thought it might lead to some performance increases across the board.

As of 7.4.4 / 7.5.1, containers have a property called “combine repaints”. You want to set it to true for windows that have a high number of components that are animating quickly (flashing, rotating, etc).

You don’t want to set it to true for containers that contain both small animating components and “expensive to paint” components like charts and tables.

1 Like