This commit is contained in:
Kbz-8
2024-01-30 22:22:47 +01:00
committed by AdrienLSH
parent 9356bb1560
commit acff70d414
4 changed files with 27 additions and 18 deletions

View File

@ -41,8 +41,16 @@ class Segment
*/
draw(ctx)
{
ctx.moveTo(this.start.x, this.start.y);
ctx.lineTo(this.stop.x, this.stop.y);
if(this.gl instanceof CanvasRenderingContext2D)
{
ctx.moveTo(this.start.x, this.start.y);
ctx.lineTo(this.stop.x, this.stop.y);
}
else if(this.gl instanceof WebGLRenderingContext)
{
}
else
alert('Unknown rendering context type');
}
from_json(data)
@ -54,4 +62,4 @@ class Segment
}
}
export { Segment };
export { Segment }