From b985763280ef50a537c28ce6e811c9186859453d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 16 May 1999 19:04:45 +0000 Subject: [PATCH] Minor DC correction. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/drawing/drawing.cpp | 2 +- src/gtk/dc.cpp | 13 ++++++------- src/gtk1/dc.cpp | 13 ++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index b0d1b3d91a..d03f254d8e 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -269,7 +269,7 @@ void MyFrame::OnOption(wxCommandEvent &event) switch (event.GetInt()) { case MapMode_Text: - m_mapMode = wxMM_LOMETRIC; + m_mapMode = wxMM_TEXT; break; case MapMode_Lometric: m_mapMode = wxMM_LOMETRIC; diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp index 5148728228..ad4b1373f6 100644 --- a/src/gtk/dc.cpp +++ b/src/gtk/dc.cpp @@ -97,24 +97,21 @@ wxSize wxDC::GetPPI() const void wxDC::ComputeScaleAndOrigin() { - // CMB: copy scale to see if it changes + /* CMB: copy scale to see if it changes */ double origScaleX = m_scaleX; double origScaleY = m_scaleY; m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleY = m_logicalScaleY * m_userScaleY; - // CMB: if scale has changed call SetPen to recalulate the line width + /* CMB: if scale has changed call SetPen to recalulate the line width */ if (m_scaleX != origScaleX || m_scaleY != origScaleY) { - // this is a bit artificial, but we need to force wxDC to think - // the pen has changed - // It gives an Assert, Robert Roebling -/* + /* this is a bit artificial, but we need to force wxDC to think + the pen has changed */ wxPen pen = m_pen; m_pen = wxNullPen; SetPen( pen ); -*/ } } @@ -139,6 +136,8 @@ void wxDC::SetMapMode( int mode ) SetLogicalScale( 1.0, 1.0 ); break; } + m_mappingMode = mode; + /* we don't do this mega optimisation if (mode != wxMM_TEXT) { diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp index 5148728228..ad4b1373f6 100644 --- a/src/gtk1/dc.cpp +++ b/src/gtk1/dc.cpp @@ -97,24 +97,21 @@ wxSize wxDC::GetPPI() const void wxDC::ComputeScaleAndOrigin() { - // CMB: copy scale to see if it changes + /* CMB: copy scale to see if it changes */ double origScaleX = m_scaleX; double origScaleY = m_scaleY; m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleY = m_logicalScaleY * m_userScaleY; - // CMB: if scale has changed call SetPen to recalulate the line width + /* CMB: if scale has changed call SetPen to recalulate the line width */ if (m_scaleX != origScaleX || m_scaleY != origScaleY) { - // this is a bit artificial, but we need to force wxDC to think - // the pen has changed - // It gives an Assert, Robert Roebling -/* + /* this is a bit artificial, but we need to force wxDC to think + the pen has changed */ wxPen pen = m_pen; m_pen = wxNullPen; SetPen( pen ); -*/ } } @@ -139,6 +136,8 @@ void wxDC::SetMapMode( int mode ) SetLogicalScale( 1.0, 1.0 ); break; } + m_mappingMode = mode; + /* we don't do this mega optimisation if (mode != wxMM_TEXT) { -- 2.47.2