From: Bart House Date: Sun, 9 Dec 2018 22:02:57 +0000 (-0800) Subject: Merge branch 'win-minor' into win-fontmap X-Git-Tag: nmake-explicit-path~55^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a8d5f49837bdf9d30bceaf99e0e0ce594358dc61;p=nethack Merge branch 'win-minor' into win-fontmap # Conflicts: # win/win32/mhmap.c --- a8d5f49837bdf9d30bceaf99e0e0ce594358dc61 diff --cc win/win32/mhmap.c index 445299af1,067d9a6e9..ba82b261a --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@@ -160,22 -160,18 +160,23 @@@ mswin_map_stretch(HWND hWnd, LPSIZE map // calculate back buffer scale data->monitorScale = win10_monitor_scale(hWnd); - boolean bText = data->bAsciiMode || (u.uz.dlevel != 0 && Is_rogue_level(&u.uz)); + boolean bText = data->bAsciiMode || + (u.uz.dlevel != 0 && Is_rogue_level(&u.uz)); - if (bText) { + if (bText && !data->bFitToScreenMode) data->backScale = data->monitorScale; - } else { + else data->backScale = 1.0; - } /* set back buffer tile size */ - data->xBackTile = (int) (data->tileWidth * data->backScale); - data->yBackTile = (int) (data->tileHeight * data->backScale); + if (bText && data->bFitToScreenMode) { + data->xBackTile = wnd_size.cx / COLNO; + data->yBackTile = wnd_size.cy / ROWNO; + data->yBackTile = max(data->yBackTile, 12); + } else { + data->xBackTile = (int)(data->tileWidth * data->backScale); + data->yBackTile = (int)(data->tileHeight * data->backScale); + } if (bText) { LOGFONT lgfnt; @@@ -217,12 -211,8 +218,9 @@@ GetTextMetrics(data->backBufferDC, &textMetrics); - if (textMetrics.tmHeight > data->yBackTile) { - lgfnt.lfHeight++; - continue; - } - - if (textMetrics.tmAveCharWidth > data->xBackTile) { - if (textMetrics.tmHeight > data->yBackTile && ++ if ((textMetrics.tmHeight > data->yBackTile || ++ textMetrics.tmAveCharWidth > data->xBackTile) && + lgfnt.lfHeight < -MIN_FONT_HEIGHT) { lgfnt.lfHeight++; continue; }