瀏覽代碼

fix: 统一方格尺寸为14px, 保证每行数量一致

之前 Free/Heap 页面使用两种尺寸(18px/12px),
导致 flex-wrap 布局下每行方块数不均匀.
现在全部统一为 14px.
yl32940 1 月之前
父節點
當前提交
9f398ef961
共有 2 個文件被更改,包括 2 次插入 和 4 次删除
  1. 二進制
      analyzer/analyzer.exe
  2. 2 4
      analyzer/page.go

二進制
analyzer/analyzer.exe


+ 2 - 4
analyzer/page.go

@@ -405,8 +405,7 @@ function showHeapPages(nm){
    let isHeap=heapSet.has(p.id);
    let c=isHeap?'#4ecdc4':'#1a1a2e';
    let br=isHeap?1:.2;
-   let sz=isHeap?18:12;
-   h2+='<div style="width:'+sz+'px;height:'+sz+'px;border-radius:2px;background:'+c+';opacity:'+br+';cursor:default" title="Page #'+p.id+'\nType: '+p.ts+'\nUsage: '+p.us.toFixed(1)+'%\nSize: 16 KB'+(isHeap?'\n\u2605 Heap Page':'')+'"></div>';
+   h2+='<div style="width:14px;height:14px;border-radius:2px;background:'+c+';opacity:'+br+';cursor:default" title="Page #'+p.id+'\nType: '+p.ts+'\nUsage: '+p.us.toFixed(1)+'%\nSize: 16 KB'+(isHeap?'\n\u2605 Heap Page':'')+'"></div>';
   });
   h2+='</div>';
   h2+='<table class="dtbl" style="margin-top:12px"><thead><tr><th>Page ID</th><th>Next</th><th>Prev</th><th>Used</th><th>Usage</th></tr></thead><tbody>';
@@ -434,8 +433,7 @@ function showFreePages(){
    let isFree=freeSet.has(p.id);
    let c=isFree?'#a78bfa':'#1a1a2e';
    let br=isFree?1:.2;
-   let sz=isFree?18:12;
-   h2+='<div style="width:'+sz+'px;height:'+sz+'px;border-radius:2px;background:'+c+';opacity:'+br+';cursor:default" title="Page #'+p.id+'\nType: '+p.ts+'\nUsage: '+p.us.toFixed(1)+'%\nSize: 16 KB'+(isFree?'\n\u267B Free Page':'')+'"></div>';
+   h2+='<div style="width:14px;height:14px;border-radius:2px;background:'+c+';opacity:'+br+';cursor:default" title="Page #'+p.id+'\nType: '+p.ts+'\nUsage: '+p.us.toFixed(1)+'%\nSize: 16 KB'+(isFree?'\n\u267B Free Page':'')+'"></div>';
   });
   h2+='</div>';
   h2+='<table class="dtbl" style="margin-top:12px"><thead><tr><th>#</th><th>Page ID</th><th>Next Free</th></tr></thead><tbody>';