Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,24 @@ public void render(Canvas canvas, Number value) {
int y = reversed || horizontal ? 0 : size.height() - 1;
// Place full blocks first
for (int i = 0; i < fullChunks; i++) {
canvas.setCharAt(x, y, Style.UNSTYLED, blocks[0]);
canvas.putCharAt(x, y, Style.UNSTYLED, blocks[0]);
x += direction.dx;
y += direction.dy;
}
// Append remainder partial block if any
if (remainder > 0) {
canvas.setCharAt(x, y, Style.UNSTYLED, blocks[remainder]);
canvas.putCharAt(x, y, Style.UNSTYLED, blocks[remainder]);
x += direction.dx;
y += direction.dy;
} else if (overflow) { // Or an overflow block
canvas.setCharAt(x, y, Style.UNSTYLED, BLOCK_OVERFLOW);
canvas.putCharAt(x, y, Style.UNSTYLED, BLOCK_OVERFLOW);
x += direction.dx;
y += direction.dy;
}
// Fill the rest with spaces
int sizeLeft = maxSize - fullChunks - (overflow || remainder > 0 ? 1 : 0);
for (int i = 0; i < sizeLeft; i++) {
canvas.setCharAt(x, y, Style.UNSTYLED, ' ');
canvas.putCharAt(x, y, Style.UNSTYLED, ' ');
x += direction.dx;
y += direction.dy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Plot plot(int x, int y, Style style) {
char newDot = selectDot(rx, ry);
char existingDot = canvas.charAt(cx, cy);
char combinedDot = combineDots(existingDot, newDot);
canvas.setCharAt(cx, cy, style, combinedDot);
canvas.putCharAt(cx, cy, style, combinedDot);
return this;
}

Expand All @@ -110,14 +110,14 @@ public Plot unplot(int x, int y) {
char removeDot = selectDot(rx, ry);
char existingDot = canvas.charAt(cx, cy);
char combinedDot = uncombineDots(existingDot, removeDot);
canvas.setCharAt(cx, cy, currentStyle, combinedDot);
canvas.putCharAt(cx, cy, currentStyle, combinedDot);
return this;
}

public Plot clear() {
for (int y = 0; y < size().height(); y++) {
for (int x = 0; x < size().width(); x++) {
canvas.setCharAt(x, y, currentStyle, ' ');
canvas.putCharAt(x, y, currentStyle, ' ');
}
}
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ public SimpleBorderRenderer style(Style style) {

@Override
public void render(Canvas canvas) {
canvas.setCharAt(0, 0, style, corner(cornerStyle.topLeftChar, leftLineStyle, topLineStyle));
canvas.putCharAt(0, 0, style, corner(cornerStyle.topLeftChar, leftLineStyle, topLineStyle));
canvas.drawHLineAt(1, 0, canvas.size().width() - 1, style, topLineStyle.horizontalChar);
canvas.setCharAt(
canvas.putCharAt(
canvas.size().width() - 1,
0,
style,
corner(cornerStyle.topRightChar, rightLineStyle, topLineStyle));
canvas.drawVLineAt(0, 1, canvas.size().height() - 1, style, leftLineStyle.verticalChar);
canvas.setCharAt(
canvas.putCharAt(
0,
canvas.size().height() - 1,
style,
Expand All @@ -113,7 +113,7 @@ public void render(Canvas canvas) {
canvas.size().width() - 1,
style,
bottomLineStyle.horizontalChar);
canvas.setCharAt(
canvas.putCharAt(
canvas.size().width() - 1,
canvas.size().height() - 1,
style,
Expand Down
Loading
Loading