部件选取icon大小

This commit is contained in:
李志鹏
2026-01-28 10:08:36 +08:00
parent 1764e2a0bf
commit 0a507fb158
2 changed files with 7 additions and 1 deletions

View File

@@ -764,7 +764,7 @@
} }
.tool-content { .tool-content {
overflow-y: auto; // overflow-y: auto;
max-height: 20rem; max-height: 20rem;
margin-top: 1rem; margin-top: 1rem;
padding: 0 1.5rem; padding: 0 1.5rem;

View File

@@ -307,7 +307,12 @@ export class PartManager {
for (let i = 0; i < list.length; i++) { for (let i = 0; i < list.length; i++) {
const item = list[i]; const item = list[i];
const icon = await this.loadImageToObject(item.label === 1 ? addIcon : removeIcon); const icon = await this.loadImageToObject(item.label === 1 ? addIcon : removeIcon);
let size = 20;
let scaleX = size / (icon.width * this.partGroup.scaleX);
let scaleY = size / (icon.height * this.partGroup.scaleY);
icon.set({ icon.set({
scaleX: scaleX,
scaleY: scaleY,
left: item.x - this.partGroup.width / 2, left: item.x - this.partGroup.width / 2,
top: item.y - this.partGroup.height / 2, top: item.y - this.partGroup.height / 2,
originX: fixedObject.originX, originX: fixedObject.originX,
@@ -315,6 +320,7 @@ export class PartManager {
}) })
this.partGroup.add(icon); this.partGroup.add(icon);
} }
console.log(this.partGroup);
this.canvas.renderAll(); this.canvas.renderAll();
return true; return true;
} }