Skip to content

Cairo has an issue a drawing thick line and a very specific transform matrix #2031

@twilson90

Description

@twilson90

Sample code:

import openfl.display.Sprite;
import openfl.Lib;

class ClippingTest extends Sprite {
	public function new() {
		super();

		graphics.lineStyle(50, 0, 0.5);
		graphics.beginFill(0xff0000);
		graphics.drawCircle(150, 300, 100); // edges cut off
		graphics.endFill();

		graphics.lineStyle(1, 0x00ff00);
		graphics.drawCircle(150, 300, 125); // this draws correctly!
		scaleX = 2.7925;
		scaleY = 0.3575;
	}
}
Image

I suspected the size of the surface / bitmapdata the graphics is drawn to was incorrectly calculated by OpenFl, but that's not it.
As you can see on the same surface I draw another circle (outlining the area of the first circle) and it is not cut off on the edges.

If I set scaleX or scaleY slightly differently (+/- 0.02) then it draws correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions