MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / drawPixels

Method drawPixels

ij/src/main/java/ij/gui/Line.java:562–579  ·  view source on GitHub ↗

If the width of this line is less than or equal to one, draws the line. Otherwise draws the outline of the area of this line.

(ImageProcessor ip)

Source from the content-addressed store, hash-verified

560 /** If the width of this line is less than or equal to one, draws the line.
561 * Otherwise draws the outline of the area of this line. */
562 public void drawPixels(ImageProcessor ip) {
563 boolean fillLine = getStrokeWidth()>1 && getWidth()<=1;
564 if (fillLine)
565 ip.setLineWidth((int)Math.round(getStrokeWidth()));
566 else
567 ip.setLineWidth(1);
568 double x = getXBase();
569 double y = getYBase();
570 x1d=getXBase()+x1R; y1d=getYBase()+y1R; x2d=getXBase()+x2R; y2d=getYBase()+y2R;
571 if (getStrokeWidth()<=1 || fillLine) {
572 ip.moveTo((int)Math.round(x1d), (int)Math.round(y1d));
573 ip.lineTo((int)Math.round(x2d), (int)Math.round(y2d));
574 } else {
575 Polygon p = getPolygon();
576 ip.drawPolygon(p);
577 updateFullWindow = true;
578 }
579 }
580
581 public boolean contains(int x, int y) {
582 if (getStrokeWidth()>1) {

Callers

nothing calls this directly

Calls 10

getWidthMethod · 0.95
getPolygonMethod · 0.95
getStrokeWidthMethod · 0.80
getXBaseMethod · 0.80
getYBaseMethod · 0.80
drawPolygonMethod · 0.80
setLineWidthMethod · 0.65
roundMethod · 0.45
moveToMethod · 0.45
lineToMethod · 0.45

Tested by

no test coverage detected