Backported recent wxGenericTreeCtrl fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -291,7 +291,7 @@ private:
|
|||||||
short m_images[wxTreeItemIcon_Max];
|
short m_images[wxTreeItemIcon_Max];
|
||||||
|
|
||||||
wxCoord m_x; // (virtual) offset from top
|
wxCoord m_x; // (virtual) offset from top
|
||||||
short m_y; // (virtual) offset from left
|
wxCoord m_y; // (virtual) offset from left
|
||||||
short m_width; // width of this item
|
short m_width; // width of this item
|
||||||
unsigned char m_height; // height of this item
|
unsigned char m_height; // height of this item
|
||||||
|
|
||||||
@@ -2410,6 +2410,22 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
|
|||||||
// draw line down to last child
|
// draw line down to last child
|
||||||
oldY += GetLineHeight(children[n-1])>>1;
|
oldY += GetLineHeight(children[n-1])>>1;
|
||||||
if (HasButtons()) y_mid += 5;
|
if (HasButtons()) y_mid += 5;
|
||||||
|
|
||||||
|
// Only draw the portion of the line that is visible, in case it is huge
|
||||||
|
wxCoord xOrigin=0, yOrigin=0, width, height;
|
||||||
|
dc.GetDeviceOrigin(&xOrigin, &yOrigin);
|
||||||
|
yOrigin = abs(yOrigin);
|
||||||
|
GetClientSize(&width, &height);
|
||||||
|
|
||||||
|
// Move end points to the begining/end of the view?
|
||||||
|
if (y_mid < yOrigin)
|
||||||
|
y_mid = yOrigin;
|
||||||
|
if (oldY > yOrigin + height)
|
||||||
|
oldY = yOrigin + height;
|
||||||
|
|
||||||
|
// after the adjustments if y_mid is larger than oldY then the line
|
||||||
|
// isn't visible at all so don't draw anything
|
||||||
|
if (y_mid < oldY)
|
||||||
dc.DrawLine(x, y_mid, x, oldY);
|
dc.DrawLine(x, y_mid, x, oldY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user