|
@@ -920,8 +920,18 @@ export default class Draw {
|
|
|
|
|
|
}
|
|
|
const focusItem = stateService.getFocusItem()
|
|
|
+ const selectItem = stateService.getSelectItem()
|
|
|
if (focusItem && focusItem.type == VectorType.CustomImage) {
|
|
|
if (geometry.vectorId == focusItem.vectorId) {
|
|
|
+ this.context.lineWidth = 2/geometry.scale;
|
|
|
+ this.context.strokeStyle = Style.Select.Tag.strokeStyle
|
|
|
+ this.context.fillStyle = Style.Select.Tag.fillStyle
|
|
|
+ this.context.strokeRect( -geometry.ratio * geometry.width/2, -geometry.ratio * geometry.height/2, geometry.ratio * geometry.width/2, geometry.ratio * geometry.height/2)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (selectItem && selectItem.type == VectorType.CustomImage) {
|
|
|
+ if (geometry.vectorId == selectItem.vectorId) {
|
|
|
+ this.context.lineWidth = 2/geometry.scale;
|
|
|
this.context.strokeStyle = Style.Select.Tag.strokeStyle
|
|
|
this.context.fillStyle = Style.Select.Tag.fillStyle
|
|
|
this.context.strokeRect( -geometry.ratio * geometry.width/2, -geometry.ratio * geometry.height/2, geometry.ratio * geometry.width/2, geometry.ratio * geometry.height/2)
|
|
@@ -929,8 +939,27 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
this.context.restore()
|
|
|
+
|
|
|
+ // this.context.save()
|
|
|
+ // if(geometry.points.length>1){
|
|
|
+
|
|
|
+ // this.context.strokeStyle = 'red'
|
|
|
+ // this.context.lineWidth = 4
|
|
|
+ // let p0 = coordinate.getScreenXY(geometry.points[0])
|
|
|
+ // let p1 = coordinate.getScreenXY(geometry.points[1])
|
|
|
+ // let p2 = coordinate.getScreenXY(geometry.points[2])
|
|
|
+ // let p3 = coordinate.getScreenXY(geometry.points[3])
|
|
|
+ // this.context.beginPath()
|
|
|
+ // this.context.moveTo(p0.x,p0.y);
|
|
|
+ // this.context.lineTo(p3.x,p3.y);
|
|
|
+ // this.context.lineTo(p2.x,p2.y);
|
|
|
+ // this.context.lineTo(p1.x,p1.y);
|
|
|
+ // this.context.closePath()
|
|
|
+ // this.context.stroke();
|
|
|
+ // }
|
|
|
+ // this.context.restore()
|
|
|
// this.context.beginPath()
|
|
|
- // this.context.arc(pt.x, pt.y, 2 * coordinate.ratio, 0, Math.PI * 2, true)
|
|
|
+ // this.context.arc(pt.x-geometry.ratio * geometry.width/4*geometry.scale, pt.y-geometry.ratio * geometry.height/4*geometry.scale, 2 * coordinate.ratio, 0, Math.PI * 2, true)
|
|
|
// this.context.stroke()
|
|
|
// this.context.fill()
|
|
|
// this.context.restore()
|