Editing Zone Shapes: "undefined" coordinates

Support and queries relating to all previous versions of ZoneMinder
Locked
proxorp
Posts: 9
Joined: Wed Feb 23, 2005 8:43 pm

Editing Zone Shapes: "undefined" coordinates

Post by proxorp »

Has anyone else noticed a this problem:

When editing a zone and trying to change the coordinates of points that define the zone....

...the X,Y coordinates of the point is (incorrectly) set to "undefined,undefined" when using the mouse to select the new point location on the image.

All is well if I enter the new x,y location manually from keyboard (but the mouse method is preferred if it worked)

So the work around is to use the mouse to determine the x,y of where the point should go, but use the keyboard to manually enter the coordinates.

...or...

Also, I hacked around on the file zm_html_view_zone.php and got the problem fixed. I'm not a PHP/Javascript/OOP guy, so I don't know how well this really works, or if it breaks something else:

Here's what I did:

Old Code Line 555 was:

Code: Select all

                x = event.layerX;
                y = event.layerY;
New Code

Code: Select all

                event = window.event;
                x = event.offsetX;
                y = event.offsetY;
//              x = event.layerX;
//              y = event.layerY;
FWIW...

Rgds,
David.
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Okay I confirmed that a simular fix makes this work in IE (as was noted when Phil released, that this would not work in IE) but it breaks it in Firefox. No big deal as this can easly be handled.

Cheers,
Corey
proxorp
Posts: 9
Joined: Wed Feb 23, 2005 8:43 pm

Post by proxorp »

Thanks for the reply Corey. Sorry, I didn't see Phil's note that this as a known issue. BTW, I forgot to mention above that I was using IE...I hadn't tried in on Firefox.

With 1.22.0, I'm finally starting to take more advantage of zones. Definitely cool!!

-Dave
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

Yeah, Me too now :D
Phil has been working on that for almost two years that I'm aware of.
Many many coodo's to him. 8)

Cheers,
Corey

PS I'll be working on this to hopefuly have it function in both browsers tomorrow. Shouldn't be hard to do.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Events are pretty horrendous in javascript as they are handled completely differently between browsers. I will try and make it more compatible in the next release.
Phil
Locked