Skip to content

Changing color components does not update styles. #166

Description

@lehni

Changing components on e.g. document.currentStyle.fillColor does not currently update currentStyle on Scriptographer, although Color and PathStyle now implement ChangeEmitter / Receiver:

document.currentStyle = {
    strokeColor: 'white',
    strokeWidth: 10,
    fillColor: new RGBColor(0, 1, 1)
};

function onMouseDown(event) {
    document.currentStyle.fillColor.red += 0.1;
}

function onMouseDrag(event) {
    var delta = event.point - event.downPoint,
        radius = delta.length,
        points = 5 + Math.round(radius / 50),
        position = event.downPoint,
        path = new Path.Star(position, points, radius / 2, radius);
    path.rotate(delta.angle);
    // Remove the path automatically before the next mouse drag
    // event:
    path.removeOnDrag();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions