From 557362d55d1b30b7df5d4fc45b30f159f88dc7b6 Mon Sep 17 00:00:00 2001 From: mdejong Date: Sun, 28 Dec 2003 05:04:17 +0000 Subject: * 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. --- ChangeLog | 11 +++++++++++ win/tkWinMenu.c | 4 ++-- 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 + + * 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 * 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); -- cgit v0.12