g.line(minX - measureLineModelOffset, maxY, minX - measureLineLen
+ measureLineModelOffset, maxY);
g.line(minX - measureLineModelOffset, minY, minX - measureLineLen
+ measureLineModelOffset, minY);
Vec2D arrowSideBottom = new Vec2D(minX + measureLineModelOffset
- (measureLineLen * measureLineProportion), maxY);
Vec2D arrowSideTop = new Vec2D(minX + measureLineModelOffset
- (measureLineLen * measureLineProportion), minY);
g.line(arrowSideTop.x, arrowSideTop.y, arrowSideBottom.x,
arrowSideBottom.y);
g.triangle(arrowSideTop.x, arrowSideTop.y, arrowSideTop.x + arrowWidth
/ 2, arrowSideTop.y + arrowHeight, arrowSideTop.x - arrowWidth
/ 2, arrowSideTop.y + arrowHeight);
g.triangle(arrowSideBottom.x, arrowSideBottom.y, arrowSideBottom.x
+ arrowWidth / 2, arrowSideBottom.y - arrowHeight,
arrowSideBottom.x - arrowWidth / 2, arrowSideBottom.y
- arrowHeight);
Vec2D texPosY = arrowSideBottom.copy().sub(
arrowSideBottom.sub(arrowSideTop).scale(.5f));
texPosY.x -= 30;
g.textAlignY = PConstants.CENTER;
g.textSize((float) (12f / GLOBAL.getZOOM()));
g.text(Float.toString(lenY) + " :mm", texPosY.x, texPosY.y);
g.line(minX, minY - measureLineModelOffset, minX, minY - measureLineLen
+ measureLineModelOffset);
g.line(maxX, minY - measureLineModelOffset, maxX, minY - measureLineLen
+ measureLineModelOffset);
Vec2D arrowTopLeft = new Vec2D(minX, minY + measureLineModelOffset
- (measureLineLen * measureLineProportion));
Vec2D arrowTopRight = new Vec2D(maxX, minY + measureLineModelOffset
- (measureLineLen * measureLineProportion));
g.line(arrowTopLeft.x, arrowTopLeft.y, arrowTopRight.x, arrowTopRight.y);
g.triangle(arrowTopLeft.x, arrowTopLeft.y,
arrowTopLeft.x + arrowHeight, arrowTopLeft.y + arrowWidth / 2,
arrowTopLeft.x + arrowHeight, arrowTopLeft.y - arrowWidth / 2);
g.triangle(arrowTopRight.x, arrowTopRight.y, arrowTopRight.x
- arrowHeight, arrowTopRight.y + arrowWidth / 2,
arrowTopRight.x - arrowHeight, arrowTopRight.y - arrowWidth / 2);
Vec2D textPosX = arrowTopLeft.copy().sub(
arrowTopLeft.sub(arrowTopRight).scale(.5f));
textPosX.y -= 10;
g.textAlign = PConstants.CENTER;
g.text(Float.toString(lenX) + " :mm", textPosX.x, textPosX.y);