Skip to content

Commit

Permalink
Fixed line size settings
Browse files Browse the repository at this point in the history
  • Loading branch information
maccasoft committed Nov 2, 2024
1 parent 3995194 commit 028fde1
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public class DebugPlotWindow extends DebugWindow {
int colorTune;
Color[] lutColors;

int lineSize;

int textSize;
int textStyle;
int textAngle;
Expand All @@ -76,6 +78,8 @@ public DebugPlotWindow(CircularBuffer transmitBuffer) {
colorTune = 0;
lutColors = new Color[256];

lineSize = 1;

textSize = 10;
textStyle = 0b00000001;
textAngle = 0;
Expand Down Expand Up @@ -327,7 +331,7 @@ public void update(KeywordIterator iter) {

case "LINESIZE":
if (iter.hasNextNumber()) {
iter.nextNumber();
lineSize = iter.nextNumber();
}
break;

Expand Down Expand Up @@ -357,19 +361,23 @@ public void update(KeywordIterator iter) {
}
break;

case "DOT":
case "DOT": {
int sizeOverride = lineSize;
int opacityOverride = opacity;
if (iter.hasNextNumber()) { // line size
iter.nextNumber();
sizeOverride = iter.nextNumber();
}
if (iter.hasNextNumber()) { // opacity
iter.nextNumber();
opacityOverride = iter.nextNumber() & 255;
}
imageGc.setForeground(color);
imageGc.drawPoint(x, y);
imageGc.setBackground(color);
imageGc.setAlpha(opacityOverride);
imageGc.fillOval(x - sizeOverride / 2, y - sizeOverride / 2, sizeOverride, sizeOverride);
if (autoUpdate) {
canvas.redraw();
}
break;
}

case "LINE":
if (iter.hasNextNumber()) {
Expand All @@ -383,7 +391,7 @@ public void update(KeywordIterator iter) {
}
int dx = origin.x + newX;
int dy = imageSize.y - (origin.y + newY);
int size = iter.hasNextNumber() ? iter.nextNumber() : 1;
int size = iter.hasNextNumber() ? iter.nextNumber() : lineSize;
line(dx, dy, size, color);
if (autoUpdate) {
canvas.redraw();
Expand All @@ -395,7 +403,7 @@ public void update(KeywordIterator iter) {
case "CIRCLE":
if (iter.hasNextNumber()) {
int diameter = iter.nextNumber();
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : 0;
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : lineSize;
int opacityOverride = iter.hasNextNumber() ? iter.nextNumber() : opacity;
oval(diameter, diameter, sizeOverride, opacityOverride, color);
if (autoUpdate) {
Expand All @@ -409,7 +417,7 @@ public void update(KeywordIterator iter) {
int width = iter.nextNumber();
if (iter.hasNext()) {
int height = iter.nextNumber();
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : 0;
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : lineSize;
int opacityOverride = iter.hasNextNumber() ? iter.nextNumber() : opacity;
oval(width, height, sizeOverride, opacityOverride, color);
if (autoUpdate) {
Expand All @@ -424,7 +432,7 @@ public void update(KeywordIterator iter) {
int width = iter.nextNumber();
if (iter.hasNext()) {
int height = iter.nextNumber();
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : 0;
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : lineSize;
int opacityOverride = iter.hasNextNumber() ? iter.nextNumber() : opacity;
box(width, height, sizeOverride, opacityOverride, color);
if (autoUpdate) {
Expand All @@ -443,7 +451,7 @@ public void update(KeywordIterator iter) {
int radiusX = iter.nextNumber();
if (iter.hasNext()) {
int radiusY = iter.nextNumber();
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : 0;
int sizeOverride = iter.hasNextNumber() ? iter.nextNumber() : lineSize;
int opacityOverride = iter.hasNextNumber() ? iter.nextNumber() : opacity;
obox(width, height, sizeOverride, radiusX, radiusY, opacityOverride, color);
if (autoUpdate) {
Expand Down

0 comments on commit 028fde1

Please sign in to comment.