Removes some of the clear function's logic to improve clarity.
@@ -66,7 +66,7 @@ public class Screen extends Component {
* If all characters within the screen were cleared.
*/
public boolean clear(final char character) {
- return clear(character, 0, 0, super.getWidth() - 1, super.getHeight() - 1);
+ return clear(character, 0, 0, super.getWidth(), super.getHeight());
}
/**
@@ -94,11 +94,10 @@ public class Screen extends Component {
*/
public boolean clear(final char character, final int columnIndex, final int rowIndex, int width, int height) {
boolean canProceed = isPositionValid(columnIndex, rowIndex);
- canProceed &= isPositionValid(width, height);
if (canProceed) {
- width += columnIndex + 1;
- height += rowIndex + 1;
+ width += columnIndex;
+ height += rowIndex;
for (int column = columnIndex ; column < width ; column++) {
for (int row = rowIndex ; row < height ; row++) {
