mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 15:26:52 -04:00
fixed some findbugs issues
This commit is contained in:
parent
ff4a3eb8e7
commit
9f56f7b37a
@ -430,6 +430,22 @@ public class Model {
|
|||||||
return name.compareTo(o.name);
|
return name.compareTo(o.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
Signal signal = (Signal) o;
|
||||||
|
|
||||||
|
return name.equals(signal.name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return name.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return name;
|
return name;
|
||||||
|
@ -93,7 +93,7 @@ public class GraphicSVG implements Graphic, Closeable {
|
|||||||
public void drawCircle(Vector p1, Vector p2, Style style) {
|
public void drawCircle(Vector p1, Vector p2, Style style) {
|
||||||
try {
|
try {
|
||||||
Vector c = p1.add(p2).div(2);
|
Vector c = p1.add(p2).div(2);
|
||||||
double r = Math.abs(p2.sub(p1).x) / 2;
|
double r = Math.abs(p2.sub(p1).x) / 2.0;
|
||||||
if (style.isFilled())
|
if (style.isFilled())
|
||||||
w.write("<circle cx=\"" + c.x + "\" cy=\"" + c.y + "\" r=\"" + r + "\" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"" + getColor(style) + "\" />\n");
|
w.write("<circle cx=\"" + c.x + "\" cy=\"" + c.y + "\" r=\"" + r + "\" stroke=\"" + getColor(style) + "\" stroke-width=\"" + getStrokeWidth(style) + "\" fill=\"" + getColor(style) + "\" />\n");
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user