Yes, this artifact, sometimes referred to as “jaggies” occurs when a straight line is skewed. A circle is perfectly round so there are no straight angles to skew. The rendering display is made up of a grid of pixels which means that a perfectly straight line is only possible when pixels are drawn exactly horizontally or vertically. The exception to this is perhaps vector graphics where smoothing occurs to blend in these jagged artifacts so that they look clean at any angle and at any scale.
Ok, with that said, there are a few things you could actually do here to make the line appear smoother when rotating geometry with straight lines. Most notably, you can take advantage of computationally heavy anti-aliasing algorithms. Fortunately, openfl exposes AA in the project xml. To reap the benefits of this, you simply need to add
<window antialiasing="16" />. The value can be between 0 and 16, with 16 being the most expensive for your hardware to perform. Additionally, you can smooth out rough edges with a built in filter like blur or glow, depending on your use case, although this is only helpful in limited situations.
But wait a minute! Doesn’t the graphics API support drawing vector graphics and shouldn’t this resolve the problem? Well the answer is sort of complicated and its a Yes and a No. Let me explain:
By default OpenFL uses hardware rendering if your system meets the requirements. Let me just start out by saying that the GPU is not especially good at rendering Vector graphics and in fact, in OpenFL, it doesn’t. Even when utilizing GPU hardware acceleration in OpenFL, we still fall back to software rendering to draw initial Vector graphics. When displayed, these are still hardware accelerated because as soon as they’re drawn by the CPU, they are piped to the GPU as a static texture. Therefor, when you rotate the shape, you experience jagged edges that you wouldn’t normally experience if you were using the software rendered in totality. SO - with that said, another way to resolve this problem is to simply turn off hardware accelerated rendering in your project XML via
<window hardware="false" />.
I hope this not only helps you achieve your desired affect, but also understand why you experienced the undesirable one to begin with.