浏览代码

Replace floor with round

Tobias Skarhed 7 年之前
父节点
当前提交
338a37abc8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      public/app/features/dashboard/dashboard_ctrl.ts

+ 2 - 2
public/app/features/dashboard/dashboard_ctrl.ts

@@ -82,8 +82,8 @@ export class DashboardCtrl implements PanelContainer {
         this.dashboard.panels.forEach((panel, i) => {
           console.log(i);
           console.log(panel.gridPos);
-          panel.gridPos.y = Math.floor(panel.gridPos.y / scaleFactor) || 1;
-          panel.gridPos.h = Math.floor(panel.gridPos.h / scaleFactor) || 1;
+          panel.gridPos.y = Math.round(panel.gridPos.y / scaleFactor) || 1;
+          panel.gridPos.h = Math.round(panel.gridPos.h / scaleFactor) || 1;
 
           console.log(panel.gridPos);
         });