|
|
@ -968,26 +968,49 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// Path
|
|
|
|
// Path
|
|
|
|
moveTo: function CanvasGraphics_moveTo(x, y) { |
|
|
|
constructPath: function CanvasGraphics_constructPath(ops, args) { |
|
|
|
this.ctx.moveTo(x, y); |
|
|
|
var ctx = this.ctx; |
|
|
|
this.current.setCurrentPoint(x, y); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
lineTo: function CanvasGraphics_lineTo(x, y) { |
|
|
|
|
|
|
|
this.ctx.lineTo(x, y); |
|
|
|
|
|
|
|
this.current.setCurrentPoint(x, y); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
curveTo: function CanvasGraphics_curveTo(x1, y1, x2, y2, x3, y3) { |
|
|
|
|
|
|
|
this.ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3); |
|
|
|
|
|
|
|
this.current.setCurrentPoint(x3, y3); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
curveTo2: function CanvasGraphics_curveTo2(x2, y2, x3, y3) { |
|
|
|
|
|
|
|
var current = this.current; |
|
|
|
var current = this.current; |
|
|
|
this.ctx.bezierCurveTo(current.x, current.y, x2, y2, x3, y3); |
|
|
|
var x = current.x, y = current.y; |
|
|
|
current.setCurrentPoint(x3, y3); |
|
|
|
for (var i = 0, j = 0, ii = ops.length; i < ii; i++) { |
|
|
|
}, |
|
|
|
switch (ops[i] | 0) { |
|
|
|
curveTo3: function CanvasGraphics_curveTo3(x1, y1, x3, y3) { |
|
|
|
case OPS.moveTo: |
|
|
|
this.curveTo(x1, y1, x3, y3, x3, y3); |
|
|
|
x = args[j++]; |
|
|
|
this.current.setCurrentPoint(x3, y3); |
|
|
|
y = args[j++]; |
|
|
|
|
|
|
|
ctx.moveTo(x, y); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case OPS.lineTo: |
|
|
|
|
|
|
|
x = args[j++]; |
|
|
|
|
|
|
|
y = args[j++]; |
|
|
|
|
|
|
|
ctx.lineTo(x, y); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case OPS.curveTo: |
|
|
|
|
|
|
|
ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], |
|
|
|
|
|
|
|
args[j + 4], args[j + 5]); |
|
|
|
|
|
|
|
x = args[j + 4]; |
|
|
|
|
|
|
|
y = args[j + 5]; |
|
|
|
|
|
|
|
j += 6; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case OPS.curveTo2: |
|
|
|
|
|
|
|
ctx.bezierCurveTo(x, y, args[j], args[j + 1], |
|
|
|
|
|
|
|
args[j + 2], args[j + 3]); |
|
|
|
|
|
|
|
x = args[j + 2]; |
|
|
|
|
|
|
|
y = args[j + 3]; |
|
|
|
|
|
|
|
j += 4; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case OPS.curveTo3: |
|
|
|
|
|
|
|
ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], |
|
|
|
|
|
|
|
args[j + 2], args[j + 3]); |
|
|
|
|
|
|
|
x = args[j + 2]; |
|
|
|
|
|
|
|
y = args[j + 3]; |
|
|
|
|
|
|
|
j += 4; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case OPS.closePath: |
|
|
|
|
|
|
|
ctx.closePath(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
current.setCurrentPoint(x, y); |
|
|
|
}, |
|
|
|
}, |
|
|
|
closePath: function CanvasGraphics_closePath() { |
|
|
|
closePath: function CanvasGraphics_closePath() { |
|
|
|
this.ctx.closePath(); |
|
|
|
this.ctx.closePath(); |
|
|
|