Skip to content

Commit

Permalink
making sure DF never smaller than sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrasner committed Nov 3, 2022
1 parent 908b11f commit 54a041f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/GridSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ class GridSheet extends HTMLElement {
if (this.numRows <= 0) {
this.numRows = 1;
}
const size = this.dataFrame.size;
if (this.numRows > size.x) {
this.dataFrame.corner += (this.numRows - size.x);
}
this.render();
}

Expand All @@ -323,6 +327,10 @@ class GridSheet extends HTMLElement {
if (this.numColumns <= 0) {
this.numColumns = 1;
}
const size = this.dataFrame.size;
if (this.numColumns > size.y) {
this.dataFrame.corner += (this.numColumns - size.y);
}
this.render();
}

Expand Down

0 comments on commit 54a041f

Please sign in to comment.