删除日志打印

This commit is contained in:
walker 2023-07-14 18:12:58 +08:00
parent 7f70f6ea55
commit 6899504fef

View File

@ -312,7 +312,6 @@ export class ContextMenu extends Container {
} }
}); });
console.log(maxItemNameWidth, maxShortcutWidth, maxGutter);
const maxItemWidth = maxItemNameWidth + maxShortcutWidth + maxGutter; const maxItemWidth = maxItemNameWidth + maxShortcutWidth + maxGutter;
return { borderHeight, maxItemWidth }; return { borderHeight, maxItemWidth };
} }
@ -367,7 +366,6 @@ export class ContextMenu extends Container {
update() { update() {
if (this.menuOptions.groups.length !== this.groups.length) { if (this.menuOptions.groups.length !== this.groups.length) {
console.log('重新初始化菜单', this.menuOptions.title);
this.init(); this.init();
} else { } else {
this.groups.forEach((group) => group.update()); this.groups.forEach((group) => group.update());
@ -488,25 +486,6 @@ class MenuGroup extends Container {
return this.gutter + this.items[0].paddingLeft + this.items[0].paddingRight; return this.gutter + this.items[0].paddingLeft + this.items[0].paddingRight;
} }
public get maxWidth(): number {
const maxNameWidth = this.items
.map((item) => item.nameBounds.width)
.sort((a, b) => a - b)
.reverse()[0];
const maxShortcutWidth = this.items
.map((item) => item.shortcutKeyBounds.width)
.sort((a, b) => a - b)
.reverse()[0];
console.log(`group=${this.config.name}`, maxNameWidth, maxShortcutWidth);
const maxWidth =
maxNameWidth +
this.gutter +
maxShortcutWidth +
this.items[0].paddingLeft +
this.items[0].paddingRight;
return maxWidth;
}
public get totalHeight(): number { public get totalHeight(): number {
let total = 0; let total = 0;
this.items.forEach((item) => (total += item.totalHeight)); this.items.forEach((item) => (total += item.totalHeight));