Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SolidLine

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.

When creating a new SolidLine object from scratch, parameters can be passed like follows:

  • new SolidLine({ thickness: 5, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) })

Index

Constructors

constructor

  • When creating a new SolidLine object from scratch, parameters can be passed like follows:

    • new SolidLine({ thickness: 5, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) })

    Parameters

    • Optional props: Partial<LineStyleProperties>

      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(): VisibleFill
  • Get fill style of SolidLine.

    Returns VisibleFill

    VisibleFill object

getThickness

  • getThickness(): number
  • Get thickness of SolidLine

    Returns number

    Thickness as pixels

setFillStyle

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

    Example usage:

    Desired result Argument
    Specified VisibleFill new SolidFill({ color: ColorHex('#F00') })
    Changed transparency (solidFill) => solidFill.setA(80)

    Parameters

    • value: VisibleFill | ImmutableMutator<VisibleFill>

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

    Returns this

    New SolidLine object

setThickness

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

    Parameters

    • thickness: number

      Thickness as pixels. This will be rounded to closest integer!

    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
    • Optional name: undefined | string

    Returns Factory<TProps>