Does anyone know how to change the lineWidth in the DrawLine function?? I tried to do it like the examples found here which looks pretty straightforward: http://www.tutorialspoint.com/html5/canvas_drawing_lines.htm
So I tried to mod the HTML5 mojo file with how they did it in the example but it somehow gets ignored and I can not find out why, here is my code:
gxtkGraphics.prototype.DrawLine=function( x1,y1,x2,y2 ){
this.gc.lineWidth = 30;
if( this.tformed ){
var x1_t=x1 * this.ix + y1 * this.jx + this.tx;
var y1_t=x1 * this.iy + y1 * this.jy + this.ty;
var x2_t=x2 * this.ix + y2 * this.jx + this.tx;
var y2_t=x2 * this.iy + y2 * this.jy + this.ty;
this.gc.setTransform( 1,0,0,1,0,0 );
this.gc.beginPath();
this.gc.moveTo( x1_t,y1_t );
this.gc.lineTo( x2_t,y2_t );
this.gc.stroke();
this.gc.closePath();
this.gc.setTransform( this.ix,this.iy,this.jx,this.jy,this.tx,this.ty );
}else{
this.gc.beginPath();
this.gc.moveTo( x1,y1 );
this.gc.lineTo( x2,y2 );
this.gc.stroke();
this.gc.closePath();
}
}
|