Skip to content

[Enhancement] chaining for all properties of shapes #792

@datacurse

Description

@datacurse

Right now i have to assign props like stroke and linewidth on new lines like this:

const borderRect = new Two.Rectangle(x, y, w - borderWidth, h - borderWidth)
    .noFill();
  borderRect.stroke = '#E3E7EA';
  borderRect.linewidth = borderWidth;

I would like them to be chainable, just like how we chain .noFill():

const borderRect = new Two.Rectangle(x, y, w - borderWidth, h - borderWidth)
    .noFill()
    .stroke('#E3E7EA')
    .linewidth(borderWidth);

I wonder if it was not implemented due to some technical restriction, and if not i think it would be a very nice sugar for this library ^^

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions