diff options
author | Steve Northover <steve> | 2007-05-15 13:46:18 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2007-05-15 13:46:18 +0000 |
commit | 091f7909165636bfda5ab4025af1b28bc5fb0fa7 (patch) | |
tree | 76bfc789bb3d756c26d2f8435a5e17c4a74e85f8 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | |
parent | 0787423dfa530dbfaf05611023e66a361d175ccd (diff) | |
download | eclipse.platform.swt-091f7909165636bfda5ab4025af1b28bc5fb0fa7.tar.gz eclipse.platform.swt-091f7909165636bfda5ab4025af1b28bc5fb0fa7.tar.xz eclipse.platform.swt-091f7909165636bfda5ab4025af1b28bc5fb0fa7.zip |
185910 - Custom drawing listeners produce display artifacts when used with virtual TreeViewer
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index 6653ffd858..87b2d2334b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -914,7 +914,13 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, int wParam, int lParam) { } LRESULT CDDS_ITEMPREPAINT (NMTVCUSTOMDRAW nmcd, int wParam, int lParam) { - int hDC = nmcd.hdc; + /* + * Even when custom draw is being ignored, the font needs + * to be selected into the HDC so that the item bounds are + * measured correctly. + */ + //if (ignoreCustomDraw) return null; + if (nmcd.left == nmcd.right) return new LRESULT (OS.CDRF_DODEFAULT); TreeItem item = getItem (nmcd); /* * Feature in Windows. When a new tree item is inserted @@ -927,11 +933,12 @@ LRESULT CDDS_ITEMPREPAINT (NMTVCUSTOMDRAW nmcd, int wParam, int lParam) { * COMCTL32.DLL, */ if (item == null) return null; + int hDC = nmcd.hdc; int index = hwndHeader != 0 ? OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, 0, 0) : 0; int hFont = item.cellFont != null ? item.cellFont [index] : -1; if (hFont == -1) hFont = item.font; if (hFont != -1) OS.SelectObject (hDC, hFont); - if (ignoreCustomDraw || (nmcd.left == nmcd.right)) { + if (ignoreCustomDraw) { return new LRESULT (hFont == -1 ? OS.CDRF_DODEFAULT : OS.CDRF_NEWFONT); } int count = 0; |