boolean reverse = angle > Math.PI / 2 && angle <= 3 * Math.PI / 2;
if (wallEndPointJoinedToPieceLeftPoint != null) {
float offset = (float)Point2D.distance(pieceLeftPoint [0], pieceLeftPoint [1],
piecePoints [3][0], piecePoints [3][1]) + 10 / getView().getScale();
if (reverse) {
dimensionLines.add(new DimensionLine(pieceLeftPoint [0], pieceLeftPoint [1],
wallEndPointJoinedToPieceLeftPoint [0],
wallEndPointJoinedToPieceLeftPoint [1], -offset));
} else {
dimensionLines.add(new DimensionLine(wallEndPointJoinedToPieceLeftPoint [0],
wallEndPointJoinedToPieceLeftPoint [1],
pieceLeftPoint [0], pieceLeftPoint [1], offset));
}
}
if (wallEndPointJoinedToPieceRightPoint != null) {
float offset = (float)Point2D.distance(pieceRightPoint [0], pieceRightPoint [1],
piecePoints [2][0], piecePoints [2][1]) + 10 / getView().getScale();
if (reverse) {
dimensionLines.add(new DimensionLine(wallEndPointJoinedToPieceRightPoint [0],
wallEndPointJoinedToPieceRightPoint [1],
pieceRightPoint [0], pieceRightPoint [1], -offset));
} else {
dimensionLines.add(new DimensionLine(pieceRightPoint [0], pieceRightPoint [1],
wallEndPointJoinedToPieceRightPoint [0],
wallEndPointJoinedToPieceRightPoint [1], offset));
}
}
return dimensionLines;