Minor DC correction.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-05-16 19:04:45 +00:00
parent c56a9c4d73
commit b985763280
3 changed files with 13 additions and 15 deletions

View File

@@ -269,7 +269,7 @@ void MyFrame::OnOption(wxCommandEvent &event)
switch (event.GetInt()) switch (event.GetInt())
{ {
case MapMode_Text: case MapMode_Text:
m_mapMode = wxMM_LOMETRIC; m_mapMode = wxMM_TEXT;
break; break;
case MapMode_Lometric: case MapMode_Lometric:
m_mapMode = wxMM_LOMETRIC; m_mapMode = wxMM_LOMETRIC;

View File

@@ -97,24 +97,21 @@ wxSize wxDC::GetPPI() const
void wxDC::ComputeScaleAndOrigin() void wxDC::ComputeScaleAndOrigin()
{ {
// CMB: copy scale to see if it changes /* CMB: copy scale to see if it changes */
double origScaleX = m_scaleX; double origScaleX = m_scaleX;
double origScaleY = m_scaleY; double origScaleY = m_scaleY;
m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleX = m_logicalScaleX * m_userScaleX;
m_scaleY = m_logicalScaleY * m_userScaleY; 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) if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{ {
// this is a bit artificial, but we need to force wxDC to think /* this is a bit artificial, but we need to force wxDC to think
// the pen has changed the pen has changed */
// It gives an Assert, Robert Roebling
/*
wxPen pen = m_pen; wxPen pen = m_pen;
m_pen = wxNullPen; m_pen = wxNullPen;
SetPen( pen ); SetPen( pen );
*/
} }
} }
@@ -139,6 +136,8 @@ void wxDC::SetMapMode( int mode )
SetLogicalScale( 1.0, 1.0 ); SetLogicalScale( 1.0, 1.0 );
break; break;
} }
m_mappingMode = mode;
/* we don't do this mega optimisation /* we don't do this mega optimisation
if (mode != wxMM_TEXT) if (mode != wxMM_TEXT)
{ {

View File

@@ -97,24 +97,21 @@ wxSize wxDC::GetPPI() const
void wxDC::ComputeScaleAndOrigin() void wxDC::ComputeScaleAndOrigin()
{ {
// CMB: copy scale to see if it changes /* CMB: copy scale to see if it changes */
double origScaleX = m_scaleX; double origScaleX = m_scaleX;
double origScaleY = m_scaleY; double origScaleY = m_scaleY;
m_scaleX = m_logicalScaleX * m_userScaleX; m_scaleX = m_logicalScaleX * m_userScaleX;
m_scaleY = m_logicalScaleY * m_userScaleY; 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) if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{ {
// this is a bit artificial, but we need to force wxDC to think /* this is a bit artificial, but we need to force wxDC to think
// the pen has changed the pen has changed */
// It gives an Assert, Robert Roebling
/*
wxPen pen = m_pen; wxPen pen = m_pen;
m_pen = wxNullPen; m_pen = wxNullPen;
SetPen( pen ); SetPen( pen );
*/
} }
} }
@@ -139,6 +136,8 @@ void wxDC::SetMapMode( int mode )
SetLogicalScale( 1.0, 1.0 ); SetLogicalScale( 1.0, 1.0 );
break; break;
} }
m_mappingMode = mode;
/* we don't do this mega optimisation /* we don't do this mega optimisation
if (mode != wxMM_TEXT) if (mode != wxMM_TEXT)
{ {