DrawLine+Scale: thickness bug..

About Monkey 2 Forums Monkey 2 Development DrawLine+Scale: thickness bug..

This topic contains 2 replies, has 2 voices, and was last updated by  abakobo 2 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5346

    abakobo
    Participant

    Issued on github too

    [/crayon]
    #5391

    Mark Sibly
    Keymaster

    Ok, a fix for this is now up at github in develop branch – you just need to grab latest canvas.monkey2.

    The problem was due to DrawLine using ‘normal’ DrawLine if LineWidth<1. But with scaling, this isn’t always correct.

    So I’ve changed the check to LineWidth<=0 (LineWidth now defaults to 0 too) so any >0 linewidth will make mojo use it’s ‘fancy’ DrawLine, ie: draw rects instead of lines.

    I’ve also added a LineSmoothing property to Canvas (defaults to false) to control the fake antialiasing of lines. If LineSmoothing is true, lines drawn with LineWidth>0 will be antialiased-ish.

    This actually produces pretty convincing antialiased lines with LineWidth>=2 and less than about 5. Less than 2 and the line starts to ‘break up’ noticably, greater than 5 and the anitaliasing ‘fudge’ starts showing! I’ve added a little linetest banana showing this.

    I’ve also tweaked draw circle/oval/ellipse so primtives are better ‘centered’ and hopefully more symmetrical.

    There are still issues with line end points, but I think this is getting there!

    #5393

    abakobo
    Participant

    Great! Thanks.
    I use them for 2d physics debug draw so perfection is not mandatory! A bit of consistency when scaling is a good point, I hope it’s not slowing down the process..

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.