summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui_tree.pas9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/gui_tree.pas b/src/gui/gui_tree.pas
index 25d8c839..2beb35de 100644
--- a/src/gui/gui_tree.pas
+++ b/src/gui/gui_tree.pas
@@ -1257,7 +1257,7 @@ var
YPos: integer;
col: integer;
ACenterPos: integer;
- x,
+ x: integer;
y: integer;
AImageItem: TfpgImageItem;
AVisibleHeight: integer;
@@ -1325,9 +1325,12 @@ begin
w := GetColumnLeft(StepToRoot(h));
ACenterPos := YPos - FYOffset + col + (GetNodeHeight div 2);
YPos := YPos + GetNodeHeight;
+ i := GetColumnLeft(StepToRoot(h)) + GetNodeWidth(h);
- if ACenterPos > (FHScrollbar.Position - GetNodeHeight) then
+ // only paint the node if it is fully visible
+ if i > FXOffset then
begin
+// writeln('painting node: ', h.Text);
if h = Selection then // draw the selection rectangle and text
begin
if Focused then
@@ -1516,7 +1519,7 @@ begin
end;
break; //==>
end;
- end;
+ end; { while h <> nil }
Canvas.EndDraw;
end;