MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / resize

Method resize

src/tailwind/TextAnimations/ASCIIText/ASCIIText.jsx:191–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189 }
190
191 resize() {
192 this.context.font = this.font;
193 const metrics = this.context.measureText(this.txt);
194
195 const textWidth = Math.ceil(metrics.width) + 20;
196 const textHeight = Math.ceil(metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent) + 20;
197
198 this.canvas.width = textWidth;
199 this.canvas.height = textHeight;
200 }
201
202 render() {
203 this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);

Callers 1

setMeshMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected