MCPcopy Create free account
hub / github.com/pingdotgg/t3code / drawAlignmentPattern

Method drawAlignmentPattern

packages/shared/src/qrCode.ts:336–341  ·  view source on GitHub ↗
(x: int, y: int)

Source from the content-addressed store, hash-verified

334 // Draws a 5*5 alignment pattern, with the center module
335 // at (x, y). All modules must be in bounds.
336 private drawAlignmentPattern(x: int, y: int): void {
337 for (let dy = -2; dy <= 2; dy++) {
338 for (let dx = -2; dx <= 2; dx++)
339 this.setFunctionModule(x + dx, y + dy, Math.max(Math.abs(dx), Math.abs(dy)) != 1);
340 }
341 }
342
343 // Sets the color of a module and marks it as a function module.
344 // Only used by the constructor. Coordinates must be in bounds.

Callers 1

drawFunctionPatternsMethod · 0.95

Calls 1

setFunctionModuleMethod · 0.95

Tested by

no test coverage detected