@@ -10,10 +10,10 @@ import { PositionUtils } from "../utils/position-utils";
1010// -------------------------------------------------------------------------------------------------
1111
1212export interface LineStrokeSettings extends CanvasDrawToolSettings {
13- left : number ;
14- top : number ;
15- x2 : number ;
16- y2 : number ;
13+ endX : number ;
14+ endY : number ;
15+ startX : number ;
16+ startY : number ;
1717}
1818
1919// #endregion Interfaces
@@ -39,10 +39,10 @@ class LineCanvasDrawTool extends BaseCanvasDrawTool implements CanvasDrawTool {
3939
4040 public drawStrokes ( strokes : CanvasDrawToolSettings [ ] ) : void {
4141 ( strokes as LineStrokeSettings [ ] ) . forEach ( ( stroke : LineStrokeSettings ) => {
42- const startX : number = stroke . left ;
43- const endX : number = stroke . left + ( stroke . x2 * 2 ) ;
44- const startY : number = stroke . top ;
45- const endY : number = stroke . top + ( stroke . y2 * 2 ) ;
42+ const startX : number = stroke . startX ;
43+ const endX : number = stroke . endX
44+ const startY : number = stroke . startY ;
45+ const endY : number = stroke . endY ;
4646
4747 const color = stroke . stroke ;
4848 const width = stroke . strokeWidth ;
@@ -143,13 +143,13 @@ class LineCanvasDrawTool extends BaseCanvasDrawTool implements CanvasDrawTool {
143143 private _getStrokeSettings ( ) : LineStrokeSettings {
144144 // Put together tool stroke here
145145 return {
146- left : this . _previousPosition . x ,
146+ endX : this . _currentPosition . x ,
147+ endY : this . _currentPosition . y ,
148+ startX : this . _previousPosition . x ,
149+ startY : this . _previousPosition . y ,
147150 stroke : this . _uiSettings . color ,
148151 strokeWidth : this . _uiSettings . width ,
149- top : this . _previousPosition . y ,
150152 type : CanvasObjectType . line ,
151- x2 : ( this . _currentPosition . x - this . _previousPosition . x ) / 2 ,
152- y2 : ( this . _currentPosition . y - this . _previousPosition . y ) / 2 ,
153153 } ;
154154 }
155155
0 commit comments