new ControlPoint(path, position)
sdk/operations/shared/sprites/brush/control-point.js, line 31
Creates a ControlPoint
Name | Type | Description |
---|---|---|
path |
PhotoEditorSDK.Operations.SpriteOperation.BrushSprite.Path | |
position |
PhotoEditorSDK.Math.Vector2 |
Methods
-
getBezierCurve(beforeLastPoint, lastPoint, point, nextPoint){PhotoEditorSDK.Math.CubicBezierCurve}
sdk/operations/shared/sprites/brush/control-point.js, line 49 -
Calculates an interpolating cubic bezier from
lastPoint
topoint
, estimating control points frombeforeLastPoint
andnextPoint
.Name Type Description beforeLastPoint
PhotoEditorSDK.Math.Vector2 lastPoint
PhotoEditorSDK.Math.Vector2 point
PhotoEditorSDK.Math.Vector2 nextPoint
PhotoEditorSDK.Math.Vector2 Returns:
Type Description PhotoEditorSDK.Math.CubicBezierCurve -
getPosition(){PhotoEditorSDK.Math.Vector2}
sdk/operations/shared/sprites/brush/control-point.js, line 148 -
Returns the position
Returns:
Type Description PhotoEditorSDK.Math.Vector2 -
renderToCanvas(brush, canvas, lastControlPoint, hardness)
sdk/operations/shared/sprites/brush/control-point.js, line 90 -
Renders this ControlPoint to the given canvas
Name Type Default Description brush
HTMLCanvasElement canvas
HTMLCanvasElement lastControlPoint
PhotoEditorSDK.Operations.SpriteOperation.BrushSprite.ControlPoint hardness
Number 1 -
setDirty()
sdk/operations/shared/sprites/brush/control-point.js, line 155 -
Sets this ControlPoint to dirty
-
setPosition(position)
sdk/operations/shared/sprites/brush/control-point.js, line 140 -
Sets the position
Name Type Description position
PhotoEditorSDK.Math.Vector2