# 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).

## 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 24 of file zoom_func.h.

Referenced by CheckClickOnViewportSign(), HandleAutoscroll(), InitializeWindowViewport(), LargeWorldCallback(), ViewportSign::MarkDirty(), RelocateAllWindows(), ResizeSprite(), TranslateXYToTileCoord(), NWidgetViewport::UpdateViewportCoordinates(), ViewportAddString(), 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 51 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 38 of file zoom_func.h.

Referenced by MarkViewportDirty(), ErrmsgWindow::OnInitialPosition(), 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 64 of file zoom_func.h.

Referenced by MarkViewportDirty().