Use dedicated functions to covert between physical and logical coordinates of the scrolled wxPropertyGrid
This commit is contained in:
@@ -3810,12 +3810,8 @@ wxSize wxPropertyGrid::GetImageSize( wxPGProperty* p, int item ) const
|
|||||||
// takes scrolling into account
|
// takes scrolling into account
|
||||||
void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py )
|
void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py )
|
||||||
{
|
{
|
||||||
int vx, vy;
|
wxASSERT(px && py);
|
||||||
GetViewStart(&vx,&vy);
|
CalcScrolledPosition(*px, *py, px, py);
|
||||||
vy*=wxPG_PIXELS_PER_UNIT;
|
|
||||||
vx*=wxPG_PIXELS_PER_UNIT;
|
|
||||||
*px -= vx;
|
|
||||||
*py -= vy;
|
|
||||||
ClientToScreen( px, py );
|
ClientToScreen( px, py );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3823,14 +3819,7 @@ void wxPropertyGrid::ImprovedClientToScreen( int* px, int* py )
|
|||||||
|
|
||||||
wxPropertyGridHitTestResult wxPropertyGrid::HitTest( const wxPoint& pt ) const
|
wxPropertyGridHitTestResult wxPropertyGrid::HitTest( const wxPoint& pt ) const
|
||||||
{
|
{
|
||||||
wxPoint pt2;
|
return m_pState->HitTest(CalcUnscrolledPosition(pt));
|
||||||
GetViewStart(&pt2.x,&pt2.y);
|
|
||||||
pt2.x *= wxPG_PIXELS_PER_UNIT;
|
|
||||||
pt2.y *= wxPG_PIXELS_PER_UNIT;
|
|
||||||
pt2.x += pt.x;
|
|
||||||
pt2.y += pt.y;
|
|
||||||
|
|
||||||
return m_pState->HitTest(pt2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user