From f92c83992e61e69d29c2bd58eb8cc65ebe5a1e54 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 16 Jun 2018 08:52:55 -0400 Subject: [PATCH] Fixed image matching. --- windows/image.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows/image.cpp b/windows/image.cpp index 2997b092..0058aa13 100644 --- a/windows/image.cpp +++ b/windows/image.cpp @@ -112,8 +112,9 @@ IWICBitmap *uiprivImageAppropriateForDC(uiImage *i, HDC dc) m.best = NULL; m.distX = INT_MAX; m.distY = INT_MAX; - m.targetX = i->width * GetDeviceCaps(dc, LOGPIXELSX); - m.targetY = i->height * GetDeviceCaps(dc, LOGPIXELSY); + // TODO explain this + m.targetX = MulDiv(i->width, GetDeviceCaps(dc, LOGPIXELSX), 96); + m.targetY = MulDiv(i->height, GetDeviceCaps(dc, LOGPIXELSY), 96); m.foundLarger = false; for (IWICBitmap *b : *(i->bitmaps)) match(b, &m);