Svg-library - Jaggy lines

Hi

I’m having some problem with the SVG-library.

When i do simple rendering:

    var s = new SVG(Assets.getText('img/test.svg'));
    s.render(graphics);

My lines get jagged even on the most simple of shapes. I tried to pre-process the svg file by stimulating its path but without success. Is there a solution to this or how are people themselves rendering the vector? Keep in mind that i’m only working with simple shapes here.

What I’ve done previously is to render my vector graphic as bitmap and then smoothed it but i figured there’s another way without turning the vector graphic into bitmaps.

Current displayed image(Compiled for windows):

You are probably using next where there is no antialiasing working yet. Try using -Dlegacy when compiling.

Care to elaborate? I’m not sure what you mean.

You need to add -Dlegacy parameter when compiling, e.g. lime test android -Dlegacy

Fair enough. I’ve been compiling through FlashDevelop so wasn’t aware of this. Is “next” something in the new version of openfl?

That did the work! Kinda.
Thank you.

Yeah that’s exactly what it is. Openfl Next is still in early development so many features are missing. If you are using flashdevelop you can easily add additional compiler parameters by simply editing list of build targets on the top. You can add -Dlegacy to the target and it should work fine.

1 Like