diff --git a/grafonnet-7.0/layout.libsonnet b/grafonnet-7.0/layout.libsonnet index af174ef2..ee49650c 100644 --- a/grafonnet-7.0/layout.libsonnet +++ b/grafonnet-7.0/layout.libsonnet @@ -21,38 +21,38 @@ // .addPanel(...) { - // Track where the next panel should go using these private variables, aka "the cursor". - _cursor:: { - x: 0, - y: 0, - h: 0, - }, + // Track where the next panel should go using these private variables, aka "the cursor". + _cursor:: { + x: 0, + y: 0, + h: 0, + }, - // addPanels add a panel at the cursor and moves the cursor to the right by the panel width. - addPanel(panel):: - local cursor = self._cursor; - local panelWithPos = panel { - gridPos+: { - x: cursor.x, - y: cursor.y, - }, - }; - super.addPanel(panelWithPos) + { - _cursor+:: { - x+: panel.gridPos.w, - h: - if cursor.h > panel.gridPos.h - then cursor.h - else panel.gridPos.h, - }, - }, + // addPanels add a panel at the cursor and moves the cursor to the right by the panel width. + addPanel(panel):: + local cursor = self._cursor; + local panelWithPos = panel { + gridPos+: { + x: cursor.x, + y: cursor.y, + }, + }; + super.addPanel(panelWithPos) + { + _cursor+:: { + x+: panel.gridPos.w, + h: + if cursor.h > panel.gridPos.h + then cursor.h + else panel.gridPos.h, + }, + }, - // Start a new row beneath the current cursor. - nextRow():: self + { - _cursor+:: { - x: 0, - y+: super.h, - h: 0, - }, + // Start a new row beneath the current cursor. + nextRow():: self + { + _cursor+:: { + x: 0, + y+: super.h, + h: 0, }, + }, }