I'm not sure if my first e-mail made it to the list. If it already did then
sorry about the spam.
These are two small bugfixes to the printing namespace in SD.
The first one in PreviewPrintController.cs references bug
#80765.<http://bugzilla.ximian.com/show_bug.cgi?id=80765>
The second one is due to loss of precision in integer division.
Index: PrintingServicesUnix.cs
===================================================================
--- PrintingServicesUnix.cs	(revision 77797)
+++ PrintingServicesUnix.cs	(working copy)
@@ -780,10 +780,10 @@
 			}
 
 			GdipGetPostScriptGraphicsContext (name,
-				width / 100 * 72,
-				height / 100 * 72, 
-				// Harcoded dpy's
-				300, 300, ref graphics);
+				width * 72 / 100,
+				height * 72 / 100, 
+				default_page_settings.PrinterResolution.X,
+				default_page_settings.PrinterResolution.Y, ref graphics);
 
 			DOCINFO doc = new DOCINFO ();
 			doc.filename = name.ToString();
Index: PreviewPrintController.cs
===================================================================
--- PreviewPrintController.cs	(revision 77797)
+++ PreviewPrintController.cs	(working copy)
@@ -78,8 +78,7 @@
 		[MonoTODO]
 		public override Graphics OnStartPage(PrintDocument document, PrintPageEventArgs e)
 		{
-			Image image = new Bitmap (e.PageSettings.PaperSize.Width * e.PageSettings.PrinterResolution.X / 100,
-						  e.PageSettings.PaperSize.Height * e.PageSettings.PrinterResolution.Y / 100);
+			Image image = new Bitmap (e.PageSettings.PaperSize.Width, e.PageSettings.PaperSize.Height);
 
 			PreviewPageInfo info = new PreviewPageInfo (image, new Size (e.PageSettings.PaperSize.Width,
 										     e.PageSettings.PaperSize.Height));
@@ -89,8 +88,6 @@
 			Graphics g = Graphics.FromImage (info.Image);
 			g.FillRectangle (new SolidBrush (Color.White), new Rectangle (new Point (0,0), new Size (image.Width, image.Height)));
 
-			g.ScaleTransform (e.PageSettings.PrinterResolution.X / 100.0f, e.PageSettings.PrinterResolution.Y / 100.0f);
-
 			return g;
 		}
 		
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to