1234567891011121314151617181920212223242526272829303132333435 |
- "use strict";
- function ConnectionLine()
- {
- Object2D.call(this);
- /**
- * Initial point of the line.
- */
- this.from = new Vector2();
- /**
- * Final point of the line.
- */
- this.to = new Vector2();
- /**
- * Color of the line.
- */
- this.color = "#000000";
- }
- ConnectionLine.prototype = Object.create(Object2D.prototype);
- ConnectionLine.prototype.draw = function(context)
- {
- context.lineWidth = 2;
- context.strokeStyle = this.color;
- context.setLineDash([10, 10]);
-
- context.beginPath();
- context.moveTo(this.from.x, this.from.y);
- context.lineTo(this.to.x, this.to.y);
- context.stroke();
- };
|