MCPcopy Index your code
hub / github.com/processing/processing / lineToImpl

Method lineToImpl

core/src/processing/opengl/LineStroker.java:472–517  ·  view source on GitHub ↗
(int x1, int y1, int c1, boolean joinSegment)

Source from the content-addressed store, hash-verified

470 }
471
472 private void lineToImpl(int x1, int y1, int c1, boolean joinSegment) {
473 computeOffset(x0, y0, x1, y1, offset);
474 int mx = offset[0];
475 int my = offset[1];
476
477 if (!started) {
478 emitMoveTo(x0 + mx, y0 + my, color0);
479 this.sx1 = x1;
480 this.sy1 = y1;
481 this.mx0 = mx;
482 this.my0 = my;
483 started = true;
484 } else {
485 boolean ccw = isCCW(px0, py0, x0, y0, x1, y1);
486 if (joinSegment) {
487 if (joinStyle == LinePath.JOIN_MITER) {
488 drawMiter(px0, py0, x0, y0, x1, y1, omx, omy, mx, my, color0, ccw);
489 } else if (joinStyle == LinePath.JOIN_ROUND) {
490 drawRoundJoin(x0, y0, omx, omy, mx, my, 0, color0, false, ccw,
491 ROUND_JOIN_THRESHOLD);
492 }
493 } else {
494 // Draw internal joins as round
495 drawRoundJoin(x0, y0, omx, omy, mx, my, 0, color0, false, ccw,
496 ROUND_JOIN_INTERNAL_THRESHOLD);
497 }
498
499 emitLineTo(x0, y0, color0, !ccw);
500 }
501
502 emitLineTo(x0 + mx, y0 + my, color0, false);
503 emitLineTo(x1 + mx, y1 + my, c1, false);
504
505 emitLineTo(x0 - mx, y0 - my, color0, true);
506 emitLineTo(x1 - mx, y1 - my, c1, true);
507
508 this.omx = mx;
509 this.omy = my;
510 this.px0 = x0;
511 this.py0 = y0;
512 this.pcolor0 = color0;
513 this.x0 = x1;
514 this.y0 = y1;
515 this.color0 = c1;
516 this.prev = LinePath.SEG_LINETO;
517 }
518
519 public void close() {
520 if (lineToOrigin) {

Callers 3

moveToMethod · 0.95
lineToMethod · 0.95
endMethod · 0.95

Calls 6

computeOffsetMethod · 0.95
emitMoveToMethod · 0.95
isCCWMethod · 0.95
drawMiterMethod · 0.95
drawRoundJoinMethod · 0.95
emitLineToMethod · 0.95

Tested by

no test coverage detected