Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class DrawingStyle

    Applies a drawing style to a canvas context or Path2D objects, which includes all fill, stroke, and shadow attributes.

    Implements

    • ILayerElement
    • IPathHandler
    • IColorElement
    Index

    Accessors

    • get isEmpty(): boolean

      Returns true if there is nothing at all to draw for this style: fill is transparent, stroke is zero size, and there is no shadow.

      Returns boolean

    Constructors

    Methods

    • Fills and strokes the given path onto context using the current drawing style settings. The context is saved before drawing and restored afterwards. Any shadow is applied to fill layer, unless that is transparent, in which case it is applied on the stroke. The stroke can be drawn under or on top of the fill, depending on the value of strokeOver property. If a rect is given it will be passed on to StrokeStyle which will automatically scale itself if necessary.

      Parameters

      Returns void

    • Draws just the current stroke (line) style onto the given path, with or w/out the current shadow (if any). It does NOT save or restore full context, only shadow properties (if a shadow is used).

      Parameters

      Returns void

    Properties

    Style to apply as context fillStyle property.

    fillRule: CanvasFillRule = 'nonzero'

    Defines how to apply the fill style when filling Path2D paths. One of: "evenodd" or "nonzero"

    stroke: StrokeStyle

    Styles to apply as context strokeStyle, line*, and miterLimit properties (and setLineDash() method).

    shadow: ShadowStyle

    Styles to apply as context shadow* properties.

    strokeOver: boolean = true

    When styling Path2D paths, the stroke is to be drawn on top of the fill if this property is true, otherwise it will draw under the fill (only half the line width will protrude around the filled area).