Skip to content

Commit

Permalink
Update comment in `VTerminalLookAndFeel.clampDimensionToTileMultiples…
Browse files Browse the repository at this point in the history
…(Dimension)`

Delete edge case test in `VTerminalLookAndFeelTest`
  • Loading branch information
Valkryst committed Nov 13, 2024
1 parent a099da7 commit 2dec7d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public Dimension clampDimensionToTileMultiples(final Dimension dimension) {
return new Dimension(tileWidth, tileHeight);
}

// This will fail to clamp to a higher multiple, if the width is near Integer.MAX_VALUE. This is an edge case
// and is not a concern, until someone encounters it.
// This will fail to clamp to a higher multiple, if the width/height is near Integer.MAX_VALUE. This is an edge
// case and is not a concern, until someone encounters it.
return new Dimension(
(int) Math.round(dimension.getWidth() / tileWidth) * tileWidth,
(int) Math.round(dimension.getHeight() / tileHeight) * tileHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,6 @@ public void canClampDimensionWidthToHigherMultiple() {
Assertions.assertEquals(tileWidth * 2, dimension.width);
}

@Test
public void canClampDimensionWidthToHigherMultipleWhenWidthIsNearMaxInt() {
final var laf = VTerminalLookAndFeel.getInstance();

var dimension = new Dimension(Integer.MAX_VALUE, tileHeight);
dimension = laf.clampDimensionToTileMultiples(dimension);

Assertions.assertEquals(tileHeight, dimension.height);
Assertions.assertEquals(2147483640, dimension.width);
}

@Test
public void canClampDimensionWidthToLowerMultiple() {
final var laf = VTerminalLookAndFeel.getInstance();
Expand Down

0 comments on commit 2dec7d7

Please sign in to comment.