Fixed errors in OS/2's wxDC::SetMapMode (patch #1871556, needed for Filezilla).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2228,13 +2228,13 @@ void wxDC::SetMapMode(
|
|||||||
int nPixelHeight = 0;
|
int nPixelHeight = 0;
|
||||||
int nMmWidth = 1;
|
int nMmWidth = 1;
|
||||||
int nMmHeight = 1;
|
int nMmHeight = 1;
|
||||||
LONG lArray[CAPS_VERTICAL_RESOLUTION];
|
LONG lArray[CAPS_VERTICAL_RESOLUTION+1];
|
||||||
|
|
||||||
m_mappingMode = nMode;
|
m_mappingMode = nMode;
|
||||||
|
|
||||||
if(::DevQueryCaps( m_hDC
|
if(::DevQueryCaps( m_hDC
|
||||||
,CAPS_FAMILY
|
,CAPS_FAMILY // id of first item
|
||||||
,CAPS_VERTICAL_RESOLUTION
|
,CAPS_VERTICAL_RESOLUTION+1 // number of items wanted
|
||||||
,lArray
|
,lArray
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
@@ -2246,15 +2246,15 @@ void wxDC::SetMapMode(
|
|||||||
lHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
|
lHorzRes = lArray[CAPS_HORIZONTAL_RESOLUTION]; // returns pel/meter
|
||||||
lVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
|
lVertRes = lArray[CAPS_VERTICAL_RESOLUTION]; // returns pel/meter
|
||||||
nMmWidth = (lHorzRes/1000) * nPixelWidth;
|
nMmWidth = (lHorzRes/1000) * nPixelWidth;
|
||||||
nMmWidth = (lVertRes/1000) * nPixelHeight;
|
nMmHeight = (lVertRes/1000) * nPixelHeight;
|
||||||
}
|
}
|
||||||
if ((nPixelWidth == 0) || (nPixelHeight == 0) || (nMmWidth == 0) || (nMmHeight == 0))
|
if ((nPixelWidth == 0) || (nPixelHeight == 0) || (nMmWidth == 0) || (nMmHeight == 0))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double dMm2pixelsX = nPixelWidth/nMmWidth;
|
double dMm2pixelsX = nPixelWidth/(double)nMmWidth;
|
||||||
double dMm2pixelsY = nPixelHeight/nMmHeight;
|
double dMm2pixelsY = nPixelHeight/(double)nMmHeight;
|
||||||
|
|
||||||
switch (nMode)
|
switch (nMode)
|
||||||
{
|
{
|
||||||
@@ -2284,6 +2284,7 @@ void wxDC::SetMapMode(
|
|||||||
m_logicalScaleY = 1.0;
|
m_logicalScaleY = 1.0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SIZEL vSize;
|
SIZEL vSize;
|
||||||
ULONG ulOptions;
|
ULONG ulOptions;
|
||||||
|
|
||||||
@@ -2293,9 +2294,6 @@ void wxDC::SetMapMode(
|
|||||||
ulOptions = PU_ARBITRARY | GPIF_DEFAULT;
|
ulOptions = PU_ARBITRARY | GPIF_DEFAULT;
|
||||||
::GpiSetPS(m_hPS, &vSize, ulOptions);
|
::GpiSetPS(m_hPS, &vSize, ulOptions);
|
||||||
}
|
}
|
||||||
m_nWindowExtX = (int)MS_XDEV2LOG(VIEWPORT_EXTENT);
|
|
||||||
m_nWindowExtY = (int)MS_YDEV2LOG(VIEWPORT_EXTENT);
|
|
||||||
// ????
|
|
||||||
}; // end of wxDC::SetMapMode
|
}; // end of wxDC::SetMapMode
|
||||||
|
|
||||||
void wxDC::SetUserScale( double dX,
|
void wxDC::SetUserScale( double dX,
|
||||||
|
Reference in New Issue
Block a user