MCPcopy
hub / github.com/processing/p5.js / point

Method point

src/core/p5.Renderer2D.js:732–758  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

730 }
731
732 point(x, y) {
733 const ctx = this.drawingContext;
734 if (!this.states.strokeColor) {
735 return this;
736 } else if (this._getStroke() === styleEmpty) {
737 return this;
738 }
739 const s = this._getStroke();
740 const f = this._getFill();
741 if (this._clipping) {
742 const tempPath = new Path2D();
743 const drawingContextWidth = this.drawingContext.lineWidth;
744 tempPath.arc(x, y, drawingContextWidth / 2, 0, constants.TWO_PI);
745 const currentTransform = this.drawingContext.getTransform();
746 const clipBaseTransform = this._clipBaseTransform.inverse();
747 const relativeTransform = clipBaseTransform.multiply(currentTransform);
748 this.clipPath.addPath(tempPath, relativeTransform);
749 return this;
750 }
751 this._setFill(s);
752 ctx.beginPath();
753 ctx.arc(x, y, ctx.lineWidth / 2, 0, constants.TWO_PI, false);
754 ctx.fill();
755 this._setFill(f);
756
757 return this;
758 }
759
760 quad(x1, y1, x2, y2, x3, y3, x4, y4) {
761 const ctx = this.drawingContext;

Callers 4

structure.jsFile · 0.80
p5.RendererGL.jsFile · 0.80
outputs.jsFile · 0.80
primitivesFunction · 0.80

Calls 6

_getStrokeMethod · 0.95
_getFillMethod · 0.95
_setFillMethod · 0.95
arcMethod · 0.80
multiplyMethod · 0.80
fillMethod · 0.45

Tested by

no test coverage detected