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


Groups > comp.lang.javascript > #37643

Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas"

Newsgroups comp.lang.javascript
Date 2019-10-30 00:10 -0700
References (2 earlier) <d12b87a5-fecc-4d3f-adb7-a3ab97a7a33e@googlegroups.com> <XnsAAF775621EC6Deejj99@194.109.6.166> <2112f7df-3433-4721-a6dd-c06dce8a5849@googlegroups.com> <XnsAAF7EBDDE68DCeejj99@194.109.6.166> <ef0919a3-3e4d-40b5-959b-92d376029cdf@googlegroups.com>
Message-ID <6edb44ca-b491-4c62-89d1-d31fe6dc32ca@googlegroups.com> (permalink)
Subject Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas"
From luserdroog <luser.droog@gmail.com>

Show all headers | View raw


On Wednesday, October 30, 2019 at 1:18:08 AM UTC-5, Jonas Thörnvall wrote:
> Den tisdag 29 oktober 2019 kl. 23:11:20 UTC+1 skrev Evertjan.:
> > =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= <jonas.thornvall@gmail.com> wrote on 29
> > Oct 2019 in comp.lang.javascript: 
> > 
> > > I thought that when you refered to something by get elementById it was
> > > part of HTML DOM-object. 
> > 
> > You did, I didn't.
> > 
> > > Well i tried to add the listener to ctm first but it said not defined,
> > 
> > You can only add a listener to a/some DOM element, so you can first use the 
> > debugger to see if ctm points to the element you think it points to.
> > 
> > > although it just was defined right above the code that added the
> > > listener.
> > 
> > If it says "not defined" I would assume it was not defined,
> > so do some testing. 
> > 
> > ===========
> > 
> > Perhaps some DOM-elements do not allow a listener.
> > 
> > I can imagine <br> doesn't and <title></title> doesn't,
> > but <script> could. Maybe that is even implmentation-dependent.
> > 
> > 
> > -- 
> > Evertjan.
> > The Netherlands.
> > (Please change the x'es to dots in my emailaddress)
> 
> Well ctm isn't a DOM-object it is a canvas object, and i guess there is no event listener implemented for canvas object ***YET***

I think 'ctm' isn't the best name. In computer graphics, CTM usually means
Current Transformation Matrix. But here you're referring to the Graphics 
Context (which includes a transformation matrix, but I think it's a synecdoche
to confuse them). The Graphics Context is a component of the canvas, but 
it's not a DOM element per se.

The Canvas most definitely *is* a DOM element. It directly corresponds to a
<canvas> tag in the HTML. 

I think the context variable would be better named 'ctx' or 'cx'.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-10-29 02:18 -0700
  Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-10-29 10:42 +0100
    Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-10-29 03:07 -0700
      Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-10-29 11:32 +0100
        Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-10-29 06:10 -0700
          Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-10-29 23:11 +0100
            Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-10-29 23:18 -0700
              Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" luserdroog <luser.droog@gmail.com> - 2019-10-30 00:10 -0700
                Re: Where does it make sense to put the mouseOver "canvas" mouseOut "canvas" Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-10-30 01:01 -0700

csiph-web