Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39142

Re: Problems with Canvas fade in

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: Problems with Canvas fade in
Date Sat, 14 Nov 2020 16:28:35 +0100
Lines 19
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>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Trace individual.net LssIUoB1dCaGguKl4SWIQQxk9faOdjN038Ixf0qMdORIxdl2Qx
Cancel-Lock sha1:OXH22oNAG9/aMA5/92EJ5noIrNA=
In-Reply-To <dbb87995-ce89-4b36-a4c3-d265b39b3830n@googlegroups.com>
Xref csiph.com comp.lang.javascript:39142

Show key headers only | View raw


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


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