X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/72cdf4c9b3ce92addf09cfb322f0c19bfb0f8744..7de3c4699ffed015dc57f1f001ef9f5f4ac92580:/src/gtk1/dc.cpp?ds=sidebyside diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp index 489a2f102e..46ea5626c4 100644 --- a/src/gtk1/dc.cpp +++ b/src/gtk1/dc.cpp @@ -14,8 +14,8 @@ #include "wx/dc.h" -#include "gdk/gdk.h" -#include "gtk/gtk.h" +#include +#include //----------------------------------------------------------------------------- // constants @@ -38,8 +38,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 */ @@ -69,19 +71,13 @@ void wxDC::DestroyClippingRegion() // get DC capabilities // --------------------------------------------------------------------------- -void wxDC::DoGetSize( int* width, int* height ) const -{ - if (width) *width = m_maxX-m_minX; - if (height) *height = m_maxY-m_minY; -} - 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