maschek / imgmap

Javascript based imagemap editor
https://www.maschek.hu/imagemap/
GNU General Public License v2.0
59 stars 32 forks source link

Throws DOM exception on circle drawing #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. load an image
2. select circle drawing mode
3. start drawing circle, but make it very small

What is the expected output? What do you see instead?
it does just normally draw a circle, but it occasionally throws the following 
exception in my inspector:

Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 - Line 1600 (or so)

It appears to be a part of the _repaint() function

What version of the product are you using? On what browser/operating system? 
V2.2 on all browsers I've tested (windows 7)

Please provide any additional information below.

I believe the issue is simply that the canvas ctx.arc() method requires a 
radius which is a non-negative integer greater than 0. I was able to make it 
stop throwing the exception by adding this a bit higher in the source, just 
below the "var radius" declaration:

if(radius < 1){
    radius = 1;
}

Just posting in case anyone else finds this issue and needs to prevent the 
exception. Great work Adam!

Original issue reported on code.google.com by travtril...@gmail.com on 19 Nov 2012 at 4:58

GoogleCodeExporter commented 9 years ago
Thank you for your report. This looks like the duplicate of #62

Original comment by adam.mas...@gmail.com on 1 Apr 2013 at 4:40