-1

I'm looking for a way to delete a specific line without clearing and redrawing it. How to clear specific line in Canvas : HTML5 I saw this question but everyone said you must clear all the page and redraw. but is there a better way without drawing and clearing?

Vishwas R
  • 3,340
  • 1
  • 16
  • 37
alireza
  • 25
  • 5

1 Answers1

0

There is definitely a way! Try entering the coordinates of the sentences x and y and its width and height. This way you can clear only a portion of canvas. ctx.clearRect() actually clears a rectangle on the canvas and is used to clear the whole canvas by giving it 0 as the x, 0 as the y and giving it the width and height of canvas.

G Jeswin
  • 71
  • 9