API Docs for: 6.0.1
Show:

window.scrawl_Path Class

Module: scrawlPath

window.scrawl

scrawlPath module adaptions to the scrawl-canvas library object

New library sections

  • scrawl.point
  • scrawl.link

New default attributes

  • Position.pathPlace - default: 0
  • Position.pathRoll - default: 0;
  • Position.addPathRoll - default: false;
  • Position.path - default: '';

Methods

Base.clone

(
  • items
)
chainable

Clone a Scrawl.js object, optionally altering attribute values in the cloned object

(This function replaces the core function)

Parameters:

  • items Object

    Object containing attribute key:value pairs; will overwrite existing values in the cloned, but not the source, Object

Returns:

Cloned object

Example:

var box = scrawl.makeBlock({
    width: 50,
    height: 50,
    });
var newBox = box.clone({
    height: 100,
    });
newBox.get('width');        //returns 50
newBox.get('height');       //returns 100

makePath

(
  • items
)

A factory function to generate new Path entitys

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

Path entity

Example:

scrawl.makePath({
    startX: 50,
    startY: 20,
    fillStyle: 'red',
    data: 'M0,0 50,0 60,20, 10,20 0,0z',
    });

makePoint

(
  • items
)
private

A factory function to generate new Point objects

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

Point object

newPathObject

(
  • items
)
private

A factory function to generate new Path objects

Note: this function does NOT produce Path entitys - use scrawl.makePath()

Parameters:

  • items Object

    Key:value Object argument for setting attributes

Returns:

Path object

newPoint

() deprecated private

Alias for makePoint()

pathDeleteEntity

() private

scrawl.deleteEntity hook function - modified by path module

pathPositionInit

() private

Position constructor hook function - modified by path module

pathPositionSetDelta

() private

Position.setDelta hook function - modified by path module

pathPrepareToCopyCell

() private

Cell.prepareToCopyCell hook function - modified by path module

pathStamp

() private

Entity.stamp hook function - modified by path module

Properties