anchor.diff:    screenX, screenY, w, h: Integer;
     zoom, mapSizeX, mapSizeY, mapSizeMax, saveSizeMax: Single;
     pos: TKMPointF;
  +  zoomBehaviour: TKMZoomBehaviour;
     pixelData: TKMCardinalArray;
   begin
     if gGame = nil then Exit;
  
positive.code:     if aMaxImageSize > 0 then
        saveSizeMax := Min(saveSizeMax, aMaxImageSize);
  
      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);
  
      // Render once is enough, since we render to an off-screen buffer (FBO)
      Render(True);
  
negative.code:     screenY := gRender.ScreenY;
      zoom := gGame.ActiveInterface.Viewport.Zoom;
      pos := gGame.ActiveInterface.Viewport.Position;
      zoomBehaviour := gGameSettings.ZoomBehaviour;
  
      // calc resize dimensions
      // We show MapX - 1 tiles
  