部件选取icon大小
This commit is contained in:
@@ -764,7 +764,7 @@
|
||||
}
|
||||
|
||||
.tool-content {
|
||||
overflow-y: auto;
|
||||
// overflow-y: auto;
|
||||
max-height: 20rem;
|
||||
margin-top: 1rem;
|
||||
padding: 0 1.5rem;
|
||||
|
||||
@@ -307,7 +307,12 @@ export class PartManager {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i];
|
||||
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({
|
||||
scaleX: scaleX,
|
||||
scaleY: scaleY,
|
||||
left: item.x - this.partGroup.width / 2,
|
||||
top: item.y - this.partGroup.height / 2,
|
||||
originX: fixedObject.originX,
|
||||
@@ -315,6 +320,7 @@ export class PartManager {
|
||||
})
|
||||
this.partGroup.add(icon);
|
||||
}
|
||||
console.log(this.partGroup);
|
||||
this.canvas.renderAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user