Skip to content

Setting path fill, stroke, and strokeWidth properties not working as expected #509

@teddybradford

Description

@teddybradford

Expected Behavior

When creating a new Glyph, I expected the path's fill, stroke, and strokeWidth properties to be passed on to the Glyph.path property.

Current Behavior

After setting fill, stroke, and strokeWidth on a path and then adding it to a new glyph, logging glyph.getPath().path returns a path with default fill, stroke, and strokeWidth properties.

Steps to Reproduce

const bPath = new Path();
bPath.moveTo(0, 300);
bPath.lineTo(300, 600);
bPath.lineTo(600, 300);
bPath.fill = null;
bPath.stroke = 'red';
bPath.strokeWidth = 50;

const bGlyph = new Glyph({
  name: 'B',
  unicode: 65,
  advanceWidth: 650,
  path: bPath
});

console.log(bPath, bGlyph.getPath());

console.log returns:

Object { commands: (3) […], fill: null, stroke: "red", strokeWidth: 50 }
Object { commands: (3) […], fill: "black", stroke: null, strokeWidth: 1 }

Environment

  • Version used: latest
  • Font used: n/a
  • Browser Name and version: FF 99
  • Operating System and version (desktop or mobile): macOS
  • Link to your project: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions