pin和rectangle合并成group

main
zcy 2024-03-03 13:14:38 +08:00
parent 9e95cd3e62
commit 54b7322916
1 changed files with 17 additions and 2 deletions

View File

@ -166,7 +166,7 @@ class AltiumSchematicRenderer
this.graph.gridSize = 1
//Maximum size
this.graph.maximumGraphBounds = new mxRectangle(0, 0, 1920, 800)
this.graph.border = 20;
this.graph.border = 0;
var fontColor = '#FFFFFF' ;
var strokeColor = '#C0C0C0' ;
var fillColor = '#C0C0C0';
@ -415,7 +415,7 @@ class AltiumSchematicRenderer
// }
// ctx.stroke();
}
let chips = {}
var v1
for (let obj of doc.objects.filter((o) => o instanceof AltiumRectangle))
{
@ -431,6 +431,10 @@ class AltiumSchematicRenderer
'verticalLabelPosition=top;verticalAlign=bottom;fillColor='
+ this.#altiumColourToHex(obj.attributes.areacolor));
v1.setConnectable(false);
if(chips[obj.owner_record_index] == undefined){
chips[obj.owner_record_index] = []
}
chips[obj.owner_record_index].push(v1)
// if (!this.#shouldShow(obj))
// continue;
@ -522,6 +526,10 @@ class AltiumSchematicRenderer
style);
v11.geometry.relative = false;
v11.setConnectable(true);
if(chips[obj.owner_record_index] == undefined){
chips[obj.owner_record_index] = []
}
chips[obj.owner_record_index].push(v11)
// v11.geometry.offset = new mxPoint(-v11.geometry.width, 2); // ctx.strokeStyle = "#000000";
// ctx.beginPath();
// ctx.moveTo(obj.x, obj.y);
@ -1094,6 +1102,13 @@ class AltiumSchematicRenderer
// }
// ctx.stroke();
}
for (let i in chips){
let chip = this.graph.groupCells(null,0,chips[i])
chip.setStyle("border = 0")
console.log(chip.getStyle())
console.log(chip.getStyle())
}
}
finally{
this.graph.getModel().endUpdate();