Preserve -1 for dilog unit conversions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1250,9 +1250,11 @@ wxPoint wxWindowBase::ConvertPixelsToDialog(const wxPoint& pt)
|
|||||||
{
|
{
|
||||||
int charWidth = GetCharWidth();
|
int charWidth = GetCharWidth();
|
||||||
int charHeight = GetCharHeight();
|
int charHeight = GetCharHeight();
|
||||||
wxPoint pt2;
|
wxPoint pt2(-1, -1);
|
||||||
pt2.x = (int) ((pt.x * 4) / charWidth) ;
|
if (pt.x != -1)
|
||||||
pt2.y = (int) ((pt.y * 8) / charHeight) ;
|
pt2.x = (int) ((pt.x * 4) / charWidth) ;
|
||||||
|
if (pt.y != -1)
|
||||||
|
pt2.y = (int) ((pt.y * 8) / charHeight) ;
|
||||||
|
|
||||||
return pt2;
|
return pt2;
|
||||||
}
|
}
|
||||||
@@ -1261,9 +1263,11 @@ wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt)
|
|||||||
{
|
{
|
||||||
int charWidth = GetCharWidth();
|
int charWidth = GetCharWidth();
|
||||||
int charHeight = GetCharHeight();
|
int charHeight = GetCharHeight();
|
||||||
wxPoint pt2;
|
wxPoint pt2(-1, -1);
|
||||||
pt2.x = (int) ((pt.x * charWidth) / 4) ;
|
if (pt.x != -1)
|
||||||
pt2.y = (int) ((pt.y * charHeight) / 8) ;
|
pt2.x = (int) ((pt.x * charWidth) / 4) ;
|
||||||
|
if (pt.y != -1)
|
||||||
|
pt2.y = (int) ((pt.y * charHeight) / 8) ;
|
||||||
|
|
||||||
return pt2;
|
return pt2;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user