anchor.diff:      if aMaxImageSize > 0 then
         saveSizeMax := Min(saveSizeMax, aMaxImageSize);
   
  +    // zbLoose could lead to bad positioned map image
  +    gGameSettings.ZoomBehaviour := zbRestricted;
       Resize(Round(saveSizeMax * mapSizeX / mapSizeMax), Round(saveSizeMax * mapSizeY / mapSizeMax));
   
  -    // Center the map and zoom out to perfectly encapsulate it
  -    gGame.ActiveInterface.Viewport.Zoom := gGame.ActiveInterface.Viewport.ViewportClip.X/(CELL_SIZE_PX * (mapSizeX - 1));
  -    gGame.ActiveInterface.Viewport.Position := TKMPointF.New((mapSizeX - 1)/2, (mapSizeY - 1 - gGame.ActiveInterface.Viewport.TopPad)/2);
  +    // Zoom out as max as possible
  +    gGame.ActiveInterface.Viewport.Zoom := 0.01;
   
       // Render once is enough, since we render to an off-screen buffer (FBO)
       Render(True);
  
positive.code:     screenY := gRender.ScreenY;
      zoom := gGame.ActiveInterface.Viewport.Zoom;
      pos := gGame.ActiveInterface.Viewport.Position;
  
      // calc resize dimensions
      // We show MapX - 1 tiles
  
negative.code:   end;
  
    // Restore viewport params
    gGameSettings.ZoomBehaviour := zoomBehaviour; // before Resize
    Resize(screenX, screenY);
    gGame.ActiveInterface.Viewport.Zoom := zoom;
    gGame.ActiveInterface.Viewport.Position := pos;
  