Jacek Kwiecień
Jacek Kwiecień

Reputation: 12639

Changing line width for drawing into canvas (gwt)

I have a method that draws a hexaon into my canvas.

    context.beginPath();
    context.moveTo(points.get(0).X(), points.get(0).Y());
    context.lineTo(points.get(1).X(), points.get(1).Y());
    context.lineTo(points.get(2).X(), points.get(2).Y());
    context.lineTo(points.get(3).X(), points.get(3).Y());
    context.lineTo(points.get(4).X(), points.get(4).Y());
    context.lineTo(points.get(5).X(), points.get(5).Y());
    context.lineTo(points.get(0).X(), points.get(0).Y());
    context.stroke();

How could I control width of the line I draw?

Upvotes: 2

Views: 1006

Answers (1)

Daniel Kurka
Daniel Kurka

Reputation: 7985

you are looking for:

context.setLineWidth(10);

Upvotes: 4

Related Questions