Skip to content

Commit

Permalink
Merge pull request svg-net#308 from alex-sherman/master
Browse files Browse the repository at this point in the history
Fix scaling of Draw(width, height)
  • Loading branch information
tebjan committed Mar 28, 2017
2 parents 66ad5d6 + d0f4434 commit 4295943
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Source/SvgDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,6 @@ public virtual void Draw(Bitmap bitmap)
{
renderer.SetBoundable(new GenericBoundable(0, 0, bitmap.Width, bitmap.Height));

//EO, 2014-12-05: Requested to ensure proper zooming (draw the svg in the bitmap size, ==> proper scaling)
//EO, 2015-01-09, Added GetDimensions to use its returned size instead of this.Width and this.Height (request of Icarrere).
//BBN, 2015-07-29, it is unnecassary to call again GetDimensions and transform to 1x1
//JA, 2015-12-18, this is actually necessary to correctly render the Draw(rasterHeight, rasterWidth) overload, otherwise the rendered graphic doesn't scale correctly
SizeF size = this.GetDimensions();
renderer.ScaleTransform(bitmap.Width / size.Width, bitmap.Height / size.Height);

//EO, 2014-12-05: Requested to ensure proper zooming out (reduce size). Otherwise it clip the image.
this.Overflow = SvgOverflow.Auto;

Expand Down

0 comments on commit 4295943

Please sign in to comment.