画布内锚点图标偶尔不显示问题

This commit is contained in:
446052889@qq.com 2022-08-04 10:16:35 +08:00
parent 38f38bf910
commit 88562bd58e

View File

@ -4069,18 +4069,18 @@ var Designer = {
}
}
var key = q.name;
if (specialShapeConfig == undefined) {
if (specialShapeConfig == undefined || specialShapeConfig.length == 0) {
if (commonShapeConfig != undefined && commonShapeConfig[key] != undefined) {
commonShapeConfig = commonShapeConfig[key];
this.handleShapeConfigData(commonShapeConfig, q, attributesJsonArray);
}
} else {
if (commonShapeConfig == undefined) {
if (commonShapeConfig == undefined || commonShapeConfig.length == 0) {
this.handleShapeConfigData(Utils.copy(specialShapeConfig), q, attributesJsonArray);
} else {
commonShapeConfig = commonShapeConfig[key];
var tempCommonShapeConfig = [];
if (commonShapeConfig != undefined) {
if (commonShapeConfig != undefined && commonShapeConfig.length > 0) {
var dataArray = [];
var tempArray = [];
for (i = 0; i < commonShapeConfig.length; i++) {
@ -4572,6 +4572,138 @@ var Designer = {
m(j, l, o)*/
}
function m(c, y, x) {
if (c.showType == 'icon' && x.indexOf("&#x") >= 0) {// 图标重构
var h = c.horizontal;
var I = c.vertical;
var icon = x.split("|")[0];
var iconColor = x.split("|")[1];
var H = $("<div id='attr_canvas_" + c.id + "' class='attr_canvas'><i style='font-size: 20px;color:" + iconColor + "' class='awsui-iconfont'>" + icon + "</i></div>").appendTo($("#" + i.id));
var D = 0;
var a = 20;
if (x != "") {
D += 20
}
var E, F;
if (h == "mostleft") {// 左外边
E = -D - 2
} else if (h == "leftedge") {// 左线上
E = -D / 2
} else if (h == "left") {// 左内边
E = 2
} else if (h == "center") {// 中间
E = (i.props.w - D) / 2;
} else if (h == "right") {// 右内边
E = i.props.w - D - 2;
} else if (h == "rightedge") {// 右线上
E = i.props.w - D / 2
} else if (h == "mostright"){// 右外边
E = i.props.w + 2
}
if (I == "mosttop") {// 上外边
F = -a
} else if (I == "topedge") {// 上线上
F = -a / 2
} else if (I == "top") {// 上内边
F = 0
} else if (I == "middle") {// 中间
F = (i.props.h - a) / 2
} else if (I == "bottom") {// 下内边
F = i.props.h - a
} else if (I == "bottomedge") {// 下线上
F = i.props.h - a / 2
} else if (I == "mostbottom"){// 下外边
F = i.props.h
}
var g = {
x: E,
y: F,
w: D,
h: a
};
var G = Utils.getRotatedBox(g, i.props.angle, n);
H.attr({
width: G.w.toScale(),
height: G.h.toScale()
});
var d = (G.x + (i.props.x - k.x) + 10).toScale();
var e = (G.y + (i.props.y - k.y) + 10).toScale();
if (h != "mostleft" || h == "left" || h != "right") {
H.css({
left: d,
top: e
});
}
if (D > i.props.w) {
var tempShapeWidth = i.props.w;
if (tempShapeWidth < 100) {
tempShapeWidth = 100;
}
H[0].width = tempShapeWidth + 10;
H[0].height = Math.ceil(D / tempShapeWidth) * 10 + 15;
if (h == "mostleft") {
d = -tempShapeWidth + tempShapeWidth*0.2;
H.css({
left: d,
top: e
});
}
if (h == "left") {
H.css({
left: d,
top: e - 5
});
}
if (h == "left" && I != "bottom") {
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e - 5
});
}
if (I == "mosttop" || I == "bottom") {
e = e - Math.ceil(D / tempShapeWidth) * 5;
H.css({
left: d,
top: e
});
}
if (h == "center" && Math.ceil(D / tempShapeWidth) > 1) {
H.css({
left: 15,
top: e
});
}
if (h == "right" && I != "mosttop" && I != "bottom") {
d = tempShapeWidth / 4;
H.css({
left: d,
top: e
});
}
} else {
if (h == "mostleft") {
d = -D;
H.css({
left: d,
top: e
});
}
if (h == "right") {
d = i.props.w - D;
H.css({
left: d,
top: e
});
}
}
return;
}
var h = c.horizontal;
var I = c.vertical;
var H = $("<canvas id='attr_canvas_" + c.id + "' class='attr_canvas'></canvas>").appendTo($("#" + i.id));