MCPcopy Create free account
hub / github.com/LibPDF-js/core / rectangle

Method rectangle

src/drawing/path-builder.ts:212–219  ·  view source on GitHub ↗

* Add a rectangle to the current path.

(x: number, y: number, width: number, height: number)

Source from the content-addressed store, hash-verified

210 * Add a rectangle to the current path.
211 */
212 rectangle(x: number, y: number, width: number, height: number): this {
213 // Use fluent methods to ensure current point is tracked
214 return this.moveTo(x, y)
215 .lineTo(x + width, y)
216 .lineTo(x + width, y + height)
217 .lineTo(x, y + height)
218 .close();
219 }
220
221 /**
222 * Add a circle to the current path.

Calls 3

moveToMethod · 0.95
closeMethod · 0.65
lineToMethod · 0.65

Tested by 1

drawNewBadgeFunction · 0.64