锚点处理完成

This commit is contained in:
20932067@zju.edu.cn 2021-05-18 16:04:55 +08:00
parent bd5e9f4db3
commit c5dc8674e0
4 changed files with 40 additions and 34 deletions

View File

@ -14,7 +14,7 @@ import diceErEdge from './dice-er-edge'
const obj = { const obj = {
// dragAddEdge, // dragAddEdge,
// hoverEventEdit, hoverEventEdit,
// clickEventEdit, // clickEventEdit,
dragEventEdit, dragEventEdit,
keyupEventEdit, keyupEventEdit,

View File

@ -60,6 +60,7 @@ export default {
shape = group.addShape("path", { shape = group.addShape("path", {
attrs: { attrs: {
stroke: "#5B8FF9", stroke: "#5B8FF9",
lineAppendWidth:15,
path: [ path: [
["M", startPoint.x, startPoint.y], ["M", startPoint.x, startPoint.y],
[ [
@ -84,6 +85,7 @@ export default {
shape = group.addShape("path", { shape = group.addShape("path", {
attrs: { attrs: {
stroke: "#5B8FF9", stroke: "#5B8FF9",
lineAppendWidth:15,
path: [ path: [
["M", startPoint.x, startPoint.y], ["M", startPoint.x, startPoint.y],
[ [

View File

@ -203,34 +203,37 @@ export default {
}); });
if (!cfg.hideDot) { if (!cfg.hideDot) {
// utils.anchor.erDrawLeft(group,label,0,i * itemHeight + offsetY) utils.anchor.erDrawLeft(group, label, 0, i * itemHeight + offsetY)
// utils.anchor.erDrawLeft(group,label,width,i * itemHeight + offsetY) utils.anchor.erDrawLeft(group,label,width,i * itemHeight + offsetY)
listContainer.addShape("marker", { // listContainer.addShape("marker", {
attrs: { // attrs: {
x: 0, // x: 0,
y: i * itemHeight + offsetY, // y: i * itemHeight + offsetY,
r: 3, // r: 3,
stroke: boxStyle.stroke, // stroke: boxStyle.stroke,
fill: "white", // fill: "white",
radius: 2, // radius: 2,
lineWidth: 1, // lineWidth: 1,
cursor: "pointer", // cursor: "crosshair",
}, // },
name: 'marker-shape' //
}); // name: 'marker-shape'
listContainer.addShape("marker", { // });
attrs: { // listContainer.addShape("marker", {
x: width, // attrs: {
y: i * itemHeight + offsetY, // x: width,
r: 3, // y: i * itemHeight + offsetY,
stroke: boxStyle.stroke, // r: 3,
fill: "white", // stroke: boxStyle.stroke,
radius: 2, // fill: "white",
lineWidth: 1, // radius: 2,
cursor: "pointer", // lineWidth: 1,
}, // cursor: "crosshair",
name: 'markerBg-shape' //
}); //
// },
// name: 'marker-shape'
// });
} }
@ -267,7 +270,7 @@ export default {
// utils.node.setState(name, value, item) // utils.node.setState(name, value, item)
// 设置锚点状态 // 设置锚点状态
// if (vm.graphMode === 'edit') { // if (vm.graphMode === 'edit') {
utils.anchor.setState(name, value, item) utils.anchor.setState(name, value, item)
// } // }
}, },
} }

View File

@ -73,10 +73,11 @@ export default {
default: { default: {
r: 3, r: 3,
symbol: 'circle', symbol: 'circle',
fill: '#FFFFFF', lineWidth: 1,
fillOpacity: 0, fill: 'white',
stroke: '#1890FF', fillOpacity: 1,
strokeOpacity: 0, stroke: '#096DD9',
strokeOpacity: 1,
cursor: 'crosshair' cursor: 'crosshair'
}, },
hover: { hover: {