]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct setting of line width
authorRobert Roebling <robert@roebling.de>
Tue, 18 Sep 2007 17:09:12 +0000 (17:09 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 18 Sep 2007 17:09:12 +0000 (17:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/print.cpp

index 1da779765f41a28b28ec166cb8191474e9da5a4c..bc1e6c36e56a4a25227532de4b5e5abe88a367f6 100644 (file)
@@ -1847,10 +1847,14 @@ void wxGtkPrintDC::SetPen( const wxPen& pen )
 
     m_pen = pen;
 
-    double width = (double) m_pen.GetWidth();
-    if (width == 0) width = 0.1;
+    double width;
+    
+    if (m_pen.GetWidth() <= 0)
+        width = 0.1;
+    else
+        width = (double) m_pen.GetWidth();
 
-    gs_cairo->cairo_set_line_width( m_cairo, (width * m_PS2DEV) / m_scaleX );
+    gs_cairo->cairo_set_line_width( m_cairo, width * m_DEV2PS * m_scaleX );
     static const double dotted[] = {2.0, 5.0};
     static const double short_dashed[] = {4.0, 4.0};
     static const double long_dashed[] = {4.0, 8.0};