projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wxHTML not used
[wxWidgets.git]
/
src
/
gtk1
/
dc.cpp
diff --git
a/src/gtk1/dc.cpp
b/src/gtk1/dc.cpp
index da0b27c97aacfc682066728f05b7178b1f872bf7..11b2991b4057c284018c4a3b81b9ac70cfe6b25b 100644
(file)
--- a/
src/gtk1/dc.cpp
+++ b/
src/gtk1/dc.cpp
@@
-3,15
+3,18
@@
// Purpose:
// Author: Robert Roebling
// RCS-ID: $Id$
// Purpose:
// Author: Robert Roebling
// RCS-ID: $Id$
-// Copyright: (c) 1998 Robert Roebling
, Markus Holzem
+// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dc.h"
#endif
#pragma implementation "dc.h"
#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/dc.h"
#include <gdk/gdk.h>
#include "wx/dc.h"
#include <gdk/gdk.h>
@@
-38,8
+41,10
@@
wxDC::wxDC()
{
m_ok = FALSE;
{
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 */
m_needComputeScaleX = FALSE; /* not used yet */
m_needComputeScaleY = FALSE; /* not used yet */
@@
-69,19
+74,13
@@
void wxDC::DestroyClippingRegion()
// get DC capabilities
// ---------------------------------------------------------------------------
// 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 );
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
int w = 0;
int h = 0;
GetSize( &w, &h );
- if (width) *width = int( double(w) / (m_
s
caleX*m_mm_to_pix_x) );
- if (height) *height = int( double(h) / (m_
s
caleY*m_mm_to_pix_y) );
+ if (width) *width = int( double(w) / (m_
userS
caleX*m_mm_to_pix_x) );
+ if (height) *height = int( double(h) / (m_
userS
caleY*m_mm_to_pix_y) );
}
// Resolution in pixels per logical inch
}
// Resolution in pixels per logical inch