()
| 615 | } |
| 616 | |
| 617 | private void finish() { |
| 618 | if (capStyle == LinePath.CAP_ROUND) { |
| 619 | drawRoundJoin(x0, y0, omx, omy, -omx, -omy, 1, color0, false, false, |
| 620 | ROUND_JOIN_THRESHOLD); |
| 621 | } else if (capStyle == LinePath.CAP_SQUARE) { |
| 622 | long ldx = px0 - x0; |
| 623 | long ldy = py0 - y0; |
| 624 | long llen = lineLength(ldx, ldy); |
| 625 | if (0 < llen) { |
| 626 | long s = (long) lineWidth2 * 65536 / llen; |
| 627 | |
| 628 | int capx = x0 - (int) (ldx * s >> 16); |
| 629 | int capy = y0 - (int) (ldy * s >> 16); |
| 630 | |
| 631 | emitLineTo(capx + omx, capy + omy, color0); |
| 632 | emitLineTo(capx - omx, capy - omy, color0); |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | for (int i = rindex - 3; i >= 0; i -= 3) { |
| 637 | emitLineTo(reverse[i], reverse[i + 1], reverse[i + 2]); |
| 638 | } |
| 639 | this.rindex = 0; |
| 640 | |
| 641 | if (capStyle == LinePath.CAP_ROUND) { |
| 642 | drawRoundJoin(sx0, sy0, -mx0, -my0, mx0, my0, 1, scolor0, false, false, |
| 643 | ROUND_JOIN_THRESHOLD); |
| 644 | } else if (capStyle == LinePath.CAP_SQUARE) { |
| 645 | long ldx = sx1 - sx0; |
| 646 | long ldy = sy1 - sy0; |
| 647 | long llen = lineLength(ldx, ldy); |
| 648 | if (0 < llen) { |
| 649 | long s = (long) lineWidth2 * 65536 / llen; |
| 650 | |
| 651 | int capx = sx0 - (int) (ldx * s >> 16); |
| 652 | int capy = sy0 - (int) (ldy * s >> 16); |
| 653 | |
| 654 | emitLineTo(capx - mx0, capy - my0, scolor0); |
| 655 | emitLineTo(capx + mx0, capy + my0, scolor0); |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | emitClose(); |
| 660 | this.joinSegment = false; |
| 661 | } |
| 662 | |
| 663 | private void emitMoveTo(int x0, int y0, int c0) { |
| 664 | output.moveTo(x0, y0, c0); |
no test coverage detected