Skip to content

Commit

Permalink
simplified error checks for scale margins
Browse files Browse the repository at this point in the history
The sum check is done in the next if statement.
  • Loading branch information
SlicedSilver committed Jan 1, 2024
1 parent feef324 commit b2d9c1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/price-scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class PriceScale {
throw new Error(`Invalid top margin - expect value between 0 and 1, given=${top}`);
}

if (bottom < 0 || bottom > 1 || top + bottom > 1) {
if (bottom < 0 || bottom > 1) {
throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${bottom}`);
}

Expand Down

0 comments on commit b2d9c1f

Please sign in to comment.