mirror of
https://github.com/photonstorm/phaser
synced 2024-11-25 22:20:44 +00:00
The batchLine
method in the Multi Pipeline will now check to see if the dxdy len is zero, and if so, it will abort drawing the line. This fixes issues on older Android devices, such as the Samsung Galaxy S6 or Kindle 7, where it would draw erroneous lines leading up to the top-left of the canvas under WebGL when rendering a stroked rounded rectangle. Fix #5429
This commit is contained in:
parent
1249c6a965
commit
8c7c8ee2a4
1 changed files with 7 additions and 0 deletions
|
@ -873,6 +873,13 @@ var MultiPipeline = new Class({
|
|||
var dy = by - ay;
|
||||
|
||||
var len = Math.sqrt(dx * dx + dy * dy);
|
||||
|
||||
if (len === 0)
|
||||
{
|
||||
// Because we cannot (and should not) divide by zero!
|
||||
return;
|
||||
}
|
||||
|
||||
var al0 = aLineWidth * (by - ay) / len;
|
||||
var al1 = aLineWidth * (ax - bx) / len;
|
||||
var bl0 = bLineWidth * (by - ay) / len;
|
||||
|
|
Loading…
Reference in a new issue