]> granicus.if.org Git - nethack/commitdiff
Merge branch 'win-minor' into win-fontmap
authorBart House <bart@barthouse.com>
Sun, 9 Dec 2018 22:02:57 +0000 (14:02 -0800)
committerBart House <bart@barthouse.com>
Sun, 9 Dec 2018 22:02:57 +0000 (14:02 -0800)
# Conflicts:
# win/win32/mhmap.c

1  2 
win/win32/mhmap.c

index 445299af12d2b1ed36f6f120e08bb07c3664b111,067d9a6e9bc5dbb59c7fa0d176eefecc7c679d60..ba82b261ab10297a45d2b83978431cbc156ed108
@@@ -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;
  
              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;
              }