From 54b73229160a8aa9bb3f2f60d80c5b9f3f40df65 Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Sun, 3 Mar 2024 13:14:38 +0800 Subject: [PATCH] =?UTF-8?q?pin=E5=92=8Crectangle=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E6=88=90group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- altium_sch_renderer.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/altium_sch_renderer.js b/altium_sch_renderer.js index 67185ad..7333314 100644 --- a/altium_sch_renderer.js +++ b/altium_sch_renderer.js @@ -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();