Skip to content

Commit

Permalink
Using minSize instead of minW and minH properties
Browse files Browse the repository at this point in the history
  • Loading branch information
panyam committed Sep 13, 2021
1 parent 4845677 commit 4f62704
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/layouts.ts
Expand Up @@ -15,8 +15,7 @@ interface BeatViewDelegate {
export interface BeatView {
readonly beat: Beat;
readonly needsLayout: boolean;
readonly minHeight: number;
readonly minWidth: number;
readonly minSize: TSU.Geom.Size;
x: number;
y: number;
width: number;
Expand Down Expand Up @@ -339,7 +338,7 @@ export class BeatLayout {
beatView.refreshLayout();
currX += beatView.width;
}
maxHeight = Math.max(maxHeight, beatView.minHeight);
maxHeight = Math.max(maxHeight, beatView.minSize.height);
}
currY += maxHeight;
currY += this.roleSpacing;
Expand Down Expand Up @@ -421,9 +420,9 @@ export class BeatColumn {
this._maxWidth = 0;
for (const beat of this.beats) {
const beatView = beatViewDelegate.viewForBeat(beat);
const minWidth = beatView.minWidth;
if (minWidth > this._maxWidth) {
this._maxWidth = minWidth;
const minSize = beatView.minSize;
if (minSize.width > this._maxWidth) {
this._maxWidth = minSize.width;
}
}
return this._maxWidth;
Expand Down

0 comments on commit 4f62704

Please sign in to comment.