From 00f4ec79dc62dfff59c2618b0d927a216baf2e8b Mon Sep 17 00:00:00 2001 From: Juha Date: Mon, 27 Mar 2023 18:07:50 +0300 Subject: [PATCH] LCL-CustomDrawn: Fix compilation on Windows. Fix color in TCDWidgetSet.ExtTextOut. Issue #40182, patch by Bart B. --- lcl/interfaces/customdrawn/customdrawnwinapi.inc | 2 +- lcl/interfaces/customdrawn/customdrawnwinapi_win.inc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/customdrawn/customdrawnwinapi.inc b/lcl/interfaces/customdrawn/customdrawnwinapi.inc index 4d3789ff39..3843bd1cef 100644 --- a/lcl/interfaces/customdrawn/customdrawnwinapi.inc +++ b/lcl/interfaces/customdrawn/customdrawnwinapi.inc @@ -2111,7 +2111,7 @@ begin lFontSize := Round(ftFont.TextHeight(Str) * 0.75);// ToDo: Find out why this 75% factor works RealX := X + lDestCanvas.WindowOrg.X + lDestCanvas.BaseWindowOrg.X; RealY := Y + lDestCanvas.WindowOrg.Y + lDestCanvas.BaseWindowOrg.Y + lFontSize; - FTDrawer.DrawText(Str, ftFont, RealX, RealY, colBlack, 255); + FTDrawer.DrawText(Str, ftFont, RealX, RealY, lDestCanvas.Font.FPColor, 255); finally if FreeFTFont then ftFont.Free; FTDrawer.Free; diff --git a/lcl/interfaces/customdrawn/customdrawnwinapi_win.inc b/lcl/interfaces/customdrawn/customdrawnwinapi_win.inc index 6e64d8d9f7..df886c5719 100644 --- a/lcl/interfaces/customdrawn/customdrawnwinapi_win.inc +++ b/lcl/interfaces/customdrawn/customdrawnwinapi_win.inc @@ -1245,10 +1245,12 @@ begin end; *) +{$ifdef CD_UseNativeMonitors} function TCDWidgetSet.EnumDisplayMonitors(hdc: HDC; lprcClip: PRect; lpfnEnum: MonitorEnumProc; dwData: LPARAM): LongBool; begin Result := MultiMon.EnumDisplayMonitors(hdc, lprcClip, lpfnEnum, dwData); end; +{$endif} type TProcRedirRec = record