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

Method drawMiter

core/src/processing/opengl/LineStroker.java:383–416  ·  view source on GitHub ↗
(int px0, int py0, int x0, int y0, int x1, int y1,
                         int omx, int omy, int mx, int my, int color,
                         boolean rev)

Source from the content-addressed store, hash-verified

381 }
382
383 private void drawMiter(int px0, int py0, int x0, int y0, int x1, int y1,
384 int omx, int omy, int mx, int my, int color,
385 boolean rev) {
386 if (mx == omx && my == omy) {
387 return;
388 }
389 if (px0 == x0 && py0 == y0) {
390 return;
391 }
392 if (x0 == x1 && y0 == y1) {
393 return;
394 }
395
396 if (rev) {
397 omx = -omx;
398 omy = -omy;
399 mx = -mx;
400 my = -my;
401 }
402
403 computeMiter(px0 + omx, py0 + omy, x0 + omx, y0 + omy, x0 + mx, y0 + my, x1
404 + mx, y1 + my, miter);
405
406 // Compute miter length in untransformed coordinates
407 long dx = (long) miter[0] - x0;
408 long dy = (long) miter[1] - y0;
409 long a = (dy * m00 - dx * m10) >> 16;
410 long b = (dy * m01 - dx * m11) >> 16;
411 long lenSq = a * a + b * b;
412
413 if (lenSq < miterLimitSq) {
414 emitLineTo(miter[0], miter[1], color, rev);
415 }
416 }
417
418 public void moveTo(int x0, int y0, int c0) {
419 // System.out.println("LineStroker.moveTo(" + x0/65536.0 + ", " + y0/65536.0 + ")");

Callers 2

lineToImplMethod · 0.95
closeMethod · 0.95

Calls 2

computeMiterMethod · 0.95
emitLineToMethod · 0.95

Tested by

no test coverage detected