Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SolidLine<T>

Class for specifying a solid line style.

Instances of SolidLine are immutable, meaning that its setters don't modify the object, but instead return a completely new modified object.

Index

Constructors

constructor

  • Create a new SolidLine to fill the line object with a single solid Color.

    Example:

    // create linestyle with Solid fillstyle and thickness
    const solidLineStyle = new SolidLine({
     fillStyle: new SolidFill({ color: ColorHEX('#F00') }),
     thickness: 5
    })

    Parameters

    • props: Partial<LineStyleProperties<T>>

      Optional object containing parameters for creation of SolidLine

    Returns SolidLine

Methods

getDefaultHighlightStyle

  • getDefaultHighlightStyle(): this
  • Get automatically computed highlight style.

    Returns this

    LineStyle object

getFillStyle

  • getFillStyle(): T
  • Get fill style of SolidLine.

    Returns T

    SolidFill object

getHighlightThicknessMultiplier

  • getHighlightThicknessMultiplier(): number
  • Get highlighted line thickness multiplier.

    Returns number

    Line thickness multiplier.

getThickness

  • getThickness(): number
  • Get thickness of SolidLine

    Returns number

    Thickness as pixels

setFillStyle

  • Construct a new Visible line object based on this one, but with modified fill style.

    Example (SolidFill):

    // specify new fillstyle
    solidLineStyle.setFillStyle( new SolidFill({
     color: ColorHex('#F00')
    }) )
    
    // change fillstyle properties
    solidLineStyle.setFillStyle(
     solidfill => solidfill.setA( 80 )
    )

    Parameters

    • value: T | ImmutableMutator<T>

      Either a SolidFill object or a function, which will be used to create a new VisibleFill based on current value.

    Returns this

    New SolidLine object

setHighlightThicknessMultiplier

  • setHighlightThicknessMultiplier(value: number): this
  • Construct a new SolidLine object based on this one, but with modified highlight thickness multiplier.

    Only works when the highlighted style has not been set separately.

    Parameters

    • value: number

      Amount to multiply the line thickness with when highlighted.

    Returns this

setThickness

  • setThickness(thickness: number): this
  • Construct a new SolidLine object based on this one, but with modified thickness.

    Parameters

    • thickness: number

      Thickness as pixels.

    Returns this

Static Record

  • Record(defaultValues: TProps, name?: undefined | string): Factory<TProps>
  • Unlike other types in Immutable.js, the Record() function creates a new Record Factory, which is a function that creates Record instances.

    See above for examples of using Record().

    Note: Record is a factory function and not a class, and does not use the new keyword during construction.

    Type parameters

    • TProps

    Parameters

    • defaultValues: TProps
    • name: undefined | string

    Returns Factory<TProps>