Skip to content

Commit ef3f6c0

Browse files
committed
The Shape.Line object was missing a lineWidth property unless you called the setLineWidth method, causing the line to not render in Canvas only. Fix phaserjs#4068
1 parent 13a72f9 commit ef3f6c0

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Calling `Tilemap.renderDebug` ignored the layer world position when drawing to the Graphics object. It will now translate to the layer position before drawing. Fix #4061 (thanks @Zax37)
1818
* `UpdateList.shutdown` wasn't correctly iterating over the pending lists (thanks @felipeprov)
1919
* Input detection was known to be broken when the game resolution was !== 1 and the Camera zoom level was !== 1. Fix #4010 (thanks @s-s)
20+
* The `Shape.Line` object was missing a `lineWidth` property unless you called the `setLineWidth` method, causing the line to not render in Canvas only. Fix #4068 (thanks @netgfx)
2021

2122
### Examples, Documentation and TypeScript
2223

src/gameobjects/shape/line/Line.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,16 @@ var Line = new Class({
6464
var width = this.geom.right - this.geom.left;
6565
var height = this.geom.bottom - this.geom.top;
6666

67+
/**
68+
* The width (or thickness) of the line.
69+
* See the setLineWidth method for extra details on changing this on WebGL.
70+
*
71+
* @name Phaser.GameObjects.Line#lineWidth
72+
* @type {number}
73+
* @since 3.13.0
74+
*/
75+
this.lineWidth = 1;
76+
6777
/**
6878
* Private internal value. Holds the start width of the line.
6979
*

0 commit comments

Comments
 (0)