Canvas rendering issues / Text Transition rendering issues

Jim Graham james.graham at oracle.com
Wed Jan 2 18:07:12 PST 2013


I noticed that the path-based Vector enemies jump around a bit.  I'm 
wondering if this could be due to the bounds of the enemy shifting 
around as the electric lines are added.  Note that you use a stroked 
Path with its default decorations which I believe means miter joins 
which can have spikes in their contributions to bounds when you turn 
tight corners, so as the last triangular segment is randomly generated 
the angle of that last corner to the end before the path is closed can 
shoot out a miter of arbitrary length.

Try using a round or bevel join instead - both of which will have faster 
and more stable bounds computations anyway which can avoid some 
per-frame overhead.  Round would be the most stable choice for bounds, 
but bevel would be the fastest to render.  Another technique for making 
the bounds stable is to include an element that pads the bounds of your 
group beyond the most outlying "jittery" element.  For example, 
including a transparent rectangle whose bounds exceed the circle by 
enough to encompass the spiking of the miter joins or the tiny 
variations in the bevel joins would smooth out the stability of the 
bounds.  The bounds with round joins will always be fairly stable since 
they always have a constant stroke extension distance from the outermost 
points of a path...

			...jim


More information about the openjfx-dev mailing list