Applied a modification of Patch #704995 which changes how the lines

are drawn such that only the visible portions are drawn.  This is
because (I think) if the length of the line is > 32k then on at least
Win9x and GTK 1.2 the line will wrap around to the other end of the
tree ctrl...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2003-03-19 01:01:14 +00:00
parent 174046a33c
commit dd360466a5

View File

@ -2385,7 +2385,23 @@ 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;
dc.DrawLine(x, y_mid, x, oldY);
// 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);
} }
} }
} }