summaryrefslogtreecommitdiffstats
path: root/generic/tkTreeDisplay.c
diff options
context:
space:
mode:
authortreectrl <treectrl>2006-12-22 04:43:40 (GMT)
committertreectrl <treectrl>2006-12-22 04:43:40 (GMT)
commitcc4a5f3d7e11c1562db65c51050f2b7276de1229 (patch)
tree272ea592d732b95438792a44a3a68ea24294ba7a /generic/tkTreeDisplay.c
parentc03dd884af3eba8b02c799f9fed6a58bd59886a0 (diff)
downloadtktreectrl-cc4a5f3d7e11c1562db65c51050f2b7276de1229.zip
tktreectrl-cc4a5f3d7e11c1562db65c51050f2b7276de1229.tar.gz
tktreectrl-cc4a5f3d7e11c1562db65c51050f2b7276de1229.tar.bz2
Fixed improper invalidating while scrolling under WIN32. If the area to invalidate was obscurred by child windows, then the items would not be marked as needing to be redrawn.
Diffstat (limited to 'generic/tkTreeDisplay.c')
-rw-r--r--generic/tkTreeDisplay.c53
1 files changed, 17 insertions, 36 deletions
diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c
index 2272642..25286d1 100644
--- a/generic/tkTreeDisplay.c
+++ b/generic/tkTreeDisplay.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2002-2006 Tim Baker
*
- * RCS: @(#) $Id: tkTreeDisplay.c,v 1.78 2006/12/09 01:16:23 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeDisplay.c,v 1.79 2006/12/22 04:43:40 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -3070,7 +3070,8 @@ UpdateDInfoForRange(
area->flags |= DITEM_DIRTY | DITEM_ALL_DIRTY;
/* Items may have alternating background colors. */
- else if ((tree->columnBgCnt > 1) && ((index % tree->columnBgCnt) !=
+ else if ((tree->columnBgCnt > 1) &&
+ ((index % tree->columnBgCnt) !=
(dItem->index % tree->columnBgCnt)))
area->flags |= DITEM_DIRTY | DITEM_ALL_DIRTY;
@@ -3938,15 +3939,16 @@ ScrollHorizontalSimple(
/* Move pixels right */
if (offset > 0) {
x = minX;
- }
+ dirtyMin = minX;
+ dirtyMax = maxX - width;
+
/* Move pixels left */
- else {
+ } else {
x = maxX - width;
+ dirtyMin = minX + width;
+ dirtyMax = maxX;
}
- dirtyMin = minX + width;
- dirtyMax = maxX - width;
-
damageRgn = Tree_GetRegion(tree);
if (tree->doubleBuffer == DOUBLEBUFFER_WINDOW) {
@@ -3954,10 +3956,6 @@ ScrollHorizontalSimple(
tree->copyGC,
x, minY, width, maxY - minY,
x + offset, minY);
- if (offset < 0)
- dirtyMax = maxX;
- else
- dirtyMin = minX;
Tree_InvalidateArea(tree, dirtyMin, minY, dirtyMax, maxY);
Tree_FreeRegion(tree, damageRgn);
return;
@@ -3969,14 +3967,7 @@ ScrollHorizontalSimple(
Tree_InvalidateRegion(tree, damageRgn);
}
Tree_FreeRegion(tree, damageRgn);
-#ifndef WIN32
- if (offset < 0)
- dirtyMax = maxX;
- else
- dirtyMin = minX;
-#endif
- if (dirtyMin < dirtyMax)
- Tree_InvalidateArea(tree, dirtyMin, minY, dirtyMax, maxY);
+ Tree_InvalidateArea(tree, dirtyMin, minY, dirtyMax, maxY);
}
/*
@@ -4046,15 +4037,16 @@ ScrollVerticalSimple(
/* Move pixels down */
if (offset > 0) {
y = minY;
- }
+ dirtyMin = minY;
+ dirtyMax = maxY - height;
+
/* Move pixels up */
- else {
+ } else {
y = maxY - height;
+ dirtyMin = minY + height;
+ dirtyMax = maxY;
}
- dirtyMin = minY + height;
- dirtyMax = maxY - height;
-
damageRgn = Tree_GetRegion(tree);
if (tree->doubleBuffer == DOUBLEBUFFER_WINDOW) {
@@ -4062,10 +4054,6 @@ ScrollVerticalSimple(
tree->copyGC,
minX, y, maxX - minX, height,
minX, y + offset);
- if (offset < 0)
- dirtyMax = maxY;
- else
- dirtyMin = minY;
Tree_InvalidateArea(tree, minX, dirtyMin, maxX, dirtyMax);
Tree_FreeRegion(tree, damageRgn);
return;
@@ -4077,14 +4065,7 @@ ScrollVerticalSimple(
Tree_InvalidateRegion(tree, damageRgn);
}
Tree_FreeRegion(tree, damageRgn);
-#ifndef WIN32
- if (offset < 0)
- dirtyMax = maxY;
- else
- dirtyMin = minY;
-#endif
- if (dirtyMin < dirtyMax)
- Tree_InvalidateArea(tree, minX, dirtyMin, maxX, dirtyMax);
+ Tree_InvalidateArea(tree, minX, dirtyMin, maxX, dirtyMax);
}
/*