From abd8071f7962253f3ef8d3e0a8a80aa5f7711675 Mon Sep 17 00:00:00 2001 From: Simon Coghlan Date: Tue, 17 Dec 2024 09:29:35 +0000 Subject: [PATCH] - Fix "Startup" edgecase --- .../Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs index c69d3f275..e78e7a07e 100644 --- a/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs +++ b/Source/Krypton Components/Krypton.Toolkit/ButtonSpec/ButtonSpecView.cs @@ -331,9 +331,10 @@ protected virtual void OnFinishDelegate(object sender, EventArgs? e) => { // Get value from button spec passing inheritance redirector Image? baseImage = ButtonSpec.GetImage(_redirector, state); + float dpiFactor = _controller?.Target.FactorDpiX ?? 1f; return (baseImage != null) - ? CommonHelper.ScaleImageForSizedDisplay(baseImage, baseImage.Width * _controller.Target.FactorDpiX, - baseImage.Height * _controller.Target.FactorDpiY) + ? CommonHelper.ScaleImageForSizedDisplay(baseImage, baseImage.Width * dpiFactor, + baseImage.Height * dpiFactor) : null; }