Fixed issue with shapes
This commit is contained in:
parent
39b2e558bd
commit
2c93193434
@ -71,16 +71,15 @@ function Surface (ronin) {
|
|||||||
// Tracers
|
// Tracers
|
||||||
|
|
||||||
this.trace = function (shape, context) {
|
this.trace = function (shape, context) {
|
||||||
console.log(this.findType(shape))
|
if (isRect(shape)) {
|
||||||
if (shape.t === 'rect') {
|
|
||||||
this.traceRect(shape, context)
|
this.traceRect(shape, context)
|
||||||
} else if (shape.t === 'line') {
|
} else if (isLine(shape)) {
|
||||||
this.traceLine(shape, context)
|
this.traceLine(shape, context)
|
||||||
} else if (shape.t === 'circle') {
|
} else if (isCircle(shape)) {
|
||||||
this.traceCircle(shape, context)
|
this.traceCircle(shape, context)
|
||||||
} else if (shape.t === 'text') {
|
} else if (isText(shape)) {
|
||||||
this.traceText(shape, context)
|
this.traceText(shape, context)
|
||||||
} else if (shape.t === 'svg') {
|
} else if (isSvg(shape)) {
|
||||||
this.traceSVG(shape, context)
|
this.traceSVG(shape, context)
|
||||||
} else {
|
} else {
|
||||||
console.warn('Unknown type')
|
console.warn('Unknown type')
|
||||||
@ -245,6 +244,9 @@ function Surface (ronin) {
|
|||||||
function isSvg (shape) {
|
function isSvg (shape) {
|
||||||
return shape.d
|
return shape.d
|
||||||
}
|
}
|
||||||
|
function isText (shape) {
|
||||||
|
return shape.x && shape.y && shape.p && shape.t && shape.f
|
||||||
|
}
|
||||||
function isLine (shape) {
|
function isLine (shape) {
|
||||||
return shape.a && shape.a.x && shape.a.y && shape.b && shape.b.x && shape.b.y
|
return shape.a && shape.a.x && shape.a.y && shape.b && shape.b.x && shape.b.y
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user