This commit is contained in:
joylink_zhaoerwei 2023-06-05 17:42:42 +08:00
parent d541e1445b
commit 4131233113
2 changed files with 13 additions and 11 deletions

View File

@ -261,9 +261,9 @@ export function loadDrawDatas(app: GraphicApp) {
storage.links.forEach((link) => {
datas.push(new LinkData(link));
});
/* storage.Rects.forEach((rect) => {
storage.Rects.forEach((rect) => {
datas.push(new RectData(rect));
}); */
});
storage.iscsFans.forEach((fan) => {
datas.push(new IscsFanData(fan));
});

View File

@ -93,17 +93,19 @@ export class RectDraw extends GraphicDrawAssistant<RectTemplate, IRectData> {
return [x, y, w, h];
}
prepareData(data: IRectData): boolean {
if (this.point1 == null) {
console.log('Rect绘制因点不够取消绘制');
return false;
}
const p1 = this.point1 as Point;
const p2 = this.point2 as Point;
if (p1 !== null) {
const [x, y, width, height] = this.normalize(p1, p2);
const template = this.graphicTemplate;
data.point = new Point(x, y);
data.lineWidth = template.lineWidth;
data.lineColor = template.lineColor;
data.width = width;
data.height = height;
}
const [x, y, width, height] = this.normalize(p1, p2);
const template = this.graphicTemplate;
data.point = new Point(x, y);
data.lineWidth = template.lineWidth;
data.lineColor = template.lineColor;
data.width = width;
data.height = height;
return true;
}
}