X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/376aa62a5d8ead9dc9d0ab3af6628862a21137ed..785f5eaa05195f5e44a974861864324667a3326e:/src/gtk1/dc.cpp diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp index 57273f2ba5..11b2991b40 100644 --- a/src/gtk1/dc.cpp +++ b/src/gtk1/dc.cpp @@ -3,15 +3,18 @@ // Purpose: // Author: Robert Roebling // RCS-ID: $Id$ -// Copyright: (c) 1998 Robert Roebling, Markus Holzem +// Copyright: (c) 1998 Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "dc.h" #endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + #include "wx/dc.h" #include @@ -38,8 +41,10 @@ wxDC::wxDC() { m_ok = FALSE; - m_mm_to_pix_x = 1.0; - m_mm_to_pix_y = 1.0; + m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / + (double)wxGetDisplaySizeMM().GetWidth(); + m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() / + (double)wxGetDisplaySizeMM().GetHeight(); m_needComputeScaleX = FALSE; /* not used yet */ m_needComputeScaleY = FALSE; /* not used yet */ @@ -74,8 +79,8 @@ void wxDC::DoGetSizeMM( int* width, int* height ) const int w = 0; int h = 0; GetSize( &w, &h ); - if (width) *width = int( double(w) / (m_scaleX*m_mm_to_pix_x) ); - if (height) *height = int( double(h) / (m_scaleY*m_mm_to_pix_y) ); + if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) ); + if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) ); } // Resolution in pixels per logical inch