DWVv0.37.0

Style

Source: style.js:10

Style class.


Constructor

new Style(): Style

Instance Methods

getFontFamily(): string

Get the font family.

Returns

  • string — The font family.

getFontSize(): number

Get the font size.

Returns

  • number — The font size.

getStrokeWidth(): number

Get the stroke width.

Returns

  • number — The stroke width.

getTextColour(): string

Get the text colour.

Returns

  • string — The text colour.

getLineColour(): string

Get the line colour.

Returns

  • string — The line colour.

setLineColour(colour: string)

Set the line colour.

Parameters

  • colour (string) — The line colour.

setBaseScale(scale: Scalar2D)

Set the base scale.

Parameters

  • scale (Scalar2D) — The scale as {x,y}.

setZoomScale(scale: Scalar2D)

Set the zoom scale.

Parameters

  • scale (Scalar2D) — The scale as {x,y}.

getBaseScale(): Scalar2D

Get the base scale.

Returns

getZoomScale(): Scalar2D

Get the zoom scale.

Returns

scale(value: number): number

Scale an input value using the base scale.

Parameters

  • value (number) — The value to scale.

Returns

  • number — The scaled value.

applyZoomScale(value: number): Scalar2D

Apply zoom scale on an input value.

Parameters

  • value (number) — The value to scale.

Returns

  • Scalar2D — The scaled value as {x,y}.

applyZoomRatio(value: number): number

Multiply an input value by the zoom ratio (zx/zy).

Parameters

  • value (number) — The value to scale.

Returns

  • number — The scaled value.

getShadowOffset(): Scalar2D

Get the shadow offset.

Returns

getTagOpacity(): number

Get the tag opacity.

Returns

  • number — The opacity.

getTextPadding(): number

Get the text padding.

Returns

  • number — The padding.

getFontStr(): string

Get the font definition string.

Returns

  • string — The font definition string.

getLineHeight(): number

Get the line height.

Returns

  • number — The line height.

getScaledFontSize(): number

Get the font size scaled to the display.

Returns

  • number — The scaled font size.

getScaledStrokeWidth(): number

Get the stroke width scaled to the display.

Returns

  • number — The scaled stroke width.

getShadowLineColour(): string

Get the shadow line colour.

Returns

  • string — The shadow line colour.