Fixed image matching.

This commit is contained in:
Pietro Gagliardi 2018-06-16 08:52:55 -04:00
parent f1341a0485
commit f92c83992e
1 changed files with 3 additions and 2 deletions

View File

@ -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);