Skip to content

Commit

Permalink
undo some stuff and set default line thickness to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
aspiringLich committed Mar 8, 2023
1 parent 84b76b7 commit 5dbdd7f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/main/java/paintingcanvas/drawable/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Line extends Drawable<Line> {
public Line(int x1, int y1, int x2, int y2) {
super(x1, y1, Color.BLACK);
this.endOffset = new Point(x2 - x1, y2 - y1);
this.outlineStroke = new BasicStroke(5);
this.outlineStroke = new BasicStroke(1);
}

/**
Expand All @@ -46,7 +46,7 @@ public Line(int x1, int y1, int x2, int y2) {
public Line(int x1, int y1, int x2, int y2, Color color) {
super(x1, y1, color);
this.endOffset = new Point(x2 - x1, y2 - y1);
this.outlineStroke = new BasicStroke(5);
this.outlineStroke = new BasicStroke(1);
}

/**
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/paintingcanvas/drawable/Path.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,28 +54,28 @@ public Path(Color color) {
this.filled = false;
}

/**
* Set the stroke of the line.
*
* @param stroke a {@code Stroke} object to define this line's stroke
* @return The original object to allow method chaining
*/
@SuppressWarnings("unused")
public Path setStroke(Stroke stroke) {
this.outlineStroke = stroke;
return this;
}

/**
* Set the thickness of the line, equivalent to setOutline(thickness);
*
* @param thickness The thickness of the line in pixels
* @return The original object to allow method chaining
*/
public Path setThickness(int thickness) {
this.outlineStroke = new BasicStroke(thickness);
return this;
}
// /**
// * Set the stroke of the line.
// *
// * @param stroke a {@code Stroke} object to define this line's stroke
// * @return The original object to allow method chaining
// */
// @SuppressWarnings("unused")
// public Path setStroke(Stroke stroke) {
// this.outlineStroke = stroke;
// return this;
// }
//
// /**
// * Set the thickness of the line, equivalent to setOutline(thickness);
// *
// * @param thickness The thickness of the line in pixels
// * @return The original object to allow method chaining
// */
// public Path setThickness(int thickness) {
// this.outlineStroke = new BasicStroke(thickness);
// return this;
// }

/**
* Move the cursor to a new position
Expand Down

0 comments on commit 5dbdd7f

Please sign in to comment.