Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #39142
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Problems with Canvas fade in |
| Date | 2020-11-14 16:28 +0100 |
| Message-ID | <i1abd3FjqaeU1@mid.individual.net> (permalink) |
| References | <b59344c2-fe89-45c7-9d4f-0b8961f9e866n@googlegroups.com> <i16urnFu046U1@mid.individual.net> <dbb87995-ce89-4b36-a4c3-d265b39b3830n@googlegroups.com> |
Michael Haufe (TNO): > On Friday, November 13, 2020 at 2:36:17 AM UTC-6, Arno Welzel wrote: > >> Also clearing the canvas is not be done by setting its width. Yes, >> setting the width or height will clear it. But this is more a side >> effect than an official way to do this. A better approach: >> >> ctx.fillStyle = "rgb(0, 0, 0)"; >> ctx.fillRect(0, 0, canvas.width, canvas.height); > > ctx.clearRect(x, y, width, height); is more direct. I suspect faster as well. Does clearRect() also use the current fill style? -- Arno Welzel https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Problems with Canvas fade in "aaron...@gmail.com" <aaronngray@gmail.com> - 2020-11-12 15:32 -0800
Re: Problems with Canvas fade in Arno Welzel <usenet@arnowelzel.de> - 2020-11-13 09:36 +0100
Re: Problems with Canvas fade in "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-11-13 07:02 -0800
Re: Problems with Canvas fade in Arno Welzel <usenet@arnowelzel.de> - 2020-11-14 16:28 +0100
Re: Problems with Canvas fade in "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-11-14 08:30 -0800
Re: Problems with Canvas fade in "aaron...@gmail.com" <aaronngray@gmail.com> - 2020-11-20 09:35 -0800
Re: Problems with Canvas fade in "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-11-20 10:12 -0800
csiph-web