summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--win/tkWinMenu.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c5c579..4e7178f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-12-27 Mo DeJong <mdejong@users.sourceforge.net>
+
+ * win/tkWinMenu.c (DrawWindowsSystemBitmap):
+ Fix a strange Win32 bug where the logical
+ coordinates returned by a call to DPtoLP
+ are wrong the first time a menu is posted.
+ This bug manifested itself by drawing the
+ bitmap in the wrong place in a menu.
+ The fix was to pass the newly created DC
+ instead of the DC from the window.
+
2003-12-26 Mo DeJong <mdejong@users.sourceforge.net>
* win/tkWinMenu.c (DrawMenuEntryAccelerator,
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index c15cd4c..1b48d25 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinMenu.c,v 1.28 2003/12/26 22:29:07 mdejong Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.29 2003/12/28 05:04:18 mdejong Exp $
*/
#define OEMRESOURCE
@@ -1471,7 +1471,7 @@ DrawWindowsSystemBitmap(display, drawable, gc, rectPtr, bitmapID, alignFlags)
GetObject(bitmap, sizeof(BITMAP), &bm);
ptSize.x = bm.bmWidth;
ptSize.y = bm.bmHeight;
- DPtoLP(hdc, &ptSize, 1);
+ DPtoLP(scratchDC, &ptSize, 1);
ptOrg.y = ptOrg.x = 0;
DPtoLP(scratchDC, &ptOrg, 1);