This commit is contained in:
Kbz-8
2024-01-30 22:22:47 +01:00
parent 94f3838df3
commit f9e9538159
4 changed files with 27 additions and 18 deletions

View File

@ -17,8 +17,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)
@ -30,4 +38,4 @@ class Segment
}
}
export { Segment }
export { Segment }