Billy Adelphia
Billy Adelphia

Reputation: 1027

How To Join Two Shapes and act like one Shape?

Konvajs How To Join Two Shapes and act like one Shape ?

For example, I have Two Konva.Text like this

const text = new Konva.Text({
  text : 'First Text',
  fill : 'blue'
});

const text2 = new Konva.Text({
  text : 'Second Text',
  fill : 'red'
});

I want to join both text and add the stroke + strokeWidth .. I can add stroke + strokeWidth individually, but the stroke didn't quite match to each other since it act as different shape ..

I can't use Konva.Group, since it doesn't have stroke parameter ..

Upvotes: 1

Views: 51

Answers (1)

Jared H
Jared H

Reputation: 1

Group mainly allows you to move and transform the shapes together. If you want them to share things like styling, I'd recommend you use a shared variable between the two Text shapes.

Upvotes: 0

Related Questions