# zoom_func.h File Reference

Functions related to zooming. More...

`#include "zoom_type.h"`

Go to the source code of this file.

## Functions
static int | ScaleByZoom (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.
static int | UnScaleByZoom (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.
static int | ScaleByZoomLower (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL).
static int | UnScaleByZoomLower (int value, ZoomLevel zoom)
| Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL).
## Variables
ZoomLevel | _saved_scrollpos_zoom

## Detailed Description

Functions related to zooming.

Definition in file zoom_func.h.

## Function Documentation

static int ScaleByZoom | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 19 of file zoom_func.h.

Referenced by HandleAutoscroll(), InitializeWindowViewport(), LargeWorldCallback(), Station::MarkDirty(), MarkSignDirty(), RelocateAllWindows(), ResizeSprite(), TranslateXYToTileCoord(), and ViewportDrawChk().

static int ScaleByZoomLower | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift left (when zoom > ZOOM_LVL_NORMAL).

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 46 of file zoom_func.h.

static int UnScaleByZoom | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL) When shifting right, value is rounded up.

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 33 of file zoom_func.h.

Referenced by MarkViewportDirty(), and ResizeSprite().

static int UnScaleByZoomLower | ( | int | value,
|  | ZoomLevel | zoom |
| ) |  |  | `[inline, static]`

Scale by zoom level, usually shift right (when zoom > ZOOM_LVL_NORMAL).

Parameters:

  | value | value to shift
  | zoom | zoom level to shift to

Returns:
  shifted value

Definition at line 59 of file zoom_func.h.

Referenced by MarkViewportDirty().