fixing merge conflicts
This commit is contained in:
@ -1,4 +1,9 @@
|
||||
<<<<<<< HEAD
|
||||
import { Point } from "./Point.js";
|
||||
=======
|
||||
import { Point } from "./Point.js"
|
||||
import { renderCube } from "../../3D/cube.js"
|
||||
>>>>>>> de2488589cf0a579b849e706b40901c355ff35f8
|
||||
|
||||
class Segment
|
||||
{
|
||||
@ -41,8 +46,19 @@ class Segment
|
||||
*/
|
||||
draw(ctx)
|
||||
{
|
||||
ctx.moveTo(this.start.x, this.start.y);
|
||||
ctx.lineTo(this.stop.x, this.stop.y);
|
||||
if(ctx instanceof CanvasRenderingContext2D)
|
||||
{
|
||||
ctx.moveTo(this.start.x, this.start.y);
|
||||
ctx.lineTo(this.stop.x, this.stop.y);
|
||||
}
|
||||
else if(ctx instanceof WebGLRenderingContext)
|
||||
{
|
||||
renderCube(ctx, this.start.x, -3, this.start.y, 0, 0.5, 0.5, 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert('Unknown rendering context type');
|
||||
}
|
||||
}
|
||||
|
||||
from_json(data)
|
||||
@ -54,4 +70,4 @@ class Segment
|
||||
}
|
||||
}
|
||||
|
||||
export { Segment };
|
||||
export { Segment }
|
||||
|
Reference in New Issue
Block a user