Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
Borrar lienzo HTML5 con texto vertical en Javascript

Estoy tratando de borrar completamente un lienzo en JavaScript. Pero si agrego un texto vertical (girando el lienzo) y luego llamo a context.clearRect(0, 0, canvas.width, canvas.height) el texto permanece. No quiero usar canvas.width = canvas.width o eliminar el lienzo y crear uno nuevo.

Mi código:

 var canvas = document.getElementById("canvas"); var c = canvas.getContext("2d"); verticalText("text", 0, 0, 20, "Arial"); c.clearRect(0, 0, canvas.width, canvas.height); function verticalText(text, x, y, dim, font) { c.font = dim + "px " + font; var size = c.measureText(text); var tx = canvas.width / 2 + dim / 2.5; var ty = canvas.height / 2 - dim / 2.5; c.save(); c.translate(tx,ty); c.rotate(-Math.PI / 2); c.translate(-tx,-ty); c.fillText(text, canv.height - y - size.width, x); c.restore(); }

¿Qué tengo que hacer?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!