praeclarum / NGraphics

NGraphics is a cross platform library for rendering vector graphics on .NET. It provides a unified API for both immediate and retained mode graphics using high quality native renderers.
MIT License
711 stars 133 forks source link

Bug in StrechFillRect transform invocation #80

Open franzdevel opened 7 years ago

franzdevel commented 7 years ago

It seems that the parameters in Graphic.Transform have been accidentally swapped. The code reads:

public Transform Transform {
  get {
    return Transform.StretchFillRect (ViewBox, new Rect (Point.Zero, Size));
  }
}

but should be:

public Transform Transform {
  get {
    return Transform.StretchFillRect (new Rect (Point.Zero, Size), ViewBox);
  }
}

As a result, the canvas transformation applied by Graphic.Draw (which takes into account the Graphic.ViewBox) does not work correctly.

praeclarum commented 7 years ago

Ahhh, thank you. I need to write a test for this.

praeclarum commented 7 years ago

I'm not so sure if the parameters are backwards. Can you provide a test for this?