Class ZoomLevelExtensions
Extension methods for the zoom levels.
Inherited Members
Namespace: Gorgon.Editor.UI
Assembly: Gorgon.Editor.API.dll
Syntax
public static class ZoomLevelExtensions
Methods
| Edit this page View SourceFromName(string)
Function to convert a friendly name to an associated zoom level.
Declaration
public static ZoomLevels FromName(this string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name to look up. |
Returns
Type | Description |
---|---|
ZoomLevels | The associated zoom level. |
GetName(ZoomLevels)
Function to convert a ZoomLevels to its associated friendly name.
Declaration
public static string GetName(this ZoomLevels zoomLevel)
Parameters
Type | Name | Description |
---|---|---|
ZoomLevels | zoomLevel | The zoom level to retrieve the name for. |
Returns
Type | Description |
---|---|
string | The friendly name of the zoom level. |
GetNextNearest(float)
Function to retrieve the nearest previous zoom scale based on the scaling value passed in.
Declaration
public static ZoomLevels GetNextNearest(this float zoomScale)
Parameters
Type | Name | Description |
---|---|---|
float | zoomScale | The zoom scaling factor to evalute. |
Returns
Type | Description |
---|---|
ZoomLevels | The nearest previous zoom level. |
GetPrevNearest(float)
Function to retrieve the nearest previous zoom scale based on the scaling value passed in.
Declaration
public static ZoomLevels GetPrevNearest(this float zoomScale)
Parameters
Type | Name | Description |
---|---|---|
float | zoomScale | The zoom scaling factor to evalute. |
Returns
Type | Description |
---|---|
ZoomLevels | The nearest previous zoom level. |
GetScale(ZoomLevels)
Function to convert a ZoomLevels to its associated scaling factor.
Declaration
public static float GetScale(this ZoomLevels zoomLevel)
Parameters
Type | Name | Description |
---|---|---|
ZoomLevels | zoomLevel | The zoom level to retrieve the scaling factor from. |
Returns
Type | Description |
---|---|
float | The scaling factor. |
Remarks
When the zoom level is set to ToWindow, then this method will return -1.
GetZoomLevel(float)
Function to retrieve the best ZoomLevels for the value passed.
Declaration
public static ZoomLevels GetZoomLevel(this float zoomScale)
Parameters
Type | Name | Description |
---|---|---|
float | zoomScale | The scale value to evaluate. |
Returns
Type | Description |
---|---|
ZoomLevels | The zoom level that best matches the scale. |