diff --git a/config.json b/config.json index fe93823..29b9422 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "name": "Custom Imagemap", "namespace": "uzgent\\ImageMapClass", - "description": "This is an imagemap implementation that allows users to define their own images and corresponding imagemaps and checkboxes.", + "description": "This is an imagemap implementation that allows users to define their own images and corresponding imagemaps linked with checkboxes.", "authors": [ { "name": "Lieven Vaneeckhaute", diff --git a/imagemap.js b/imagemap.js index 0b920fe..e1101f6 100644 --- a/imagemap.js +++ b/imagemap.js @@ -199,7 +199,7 @@ function ImageMapAug(imageIdL, mapIdL, updateFunctionL, fillColor) { var ctx = tempcanvas.getContext("2d"); childNodes.forEach(function (child) { - if (child.nodeType !== Node.TEXT_NODE && child.nodeType !== Node.COMMENT_NODE ) { + if (child.nodeType !== Node.TEXT_NODE && child.nodeType !== Node.COMMENT_NODE && child.getAttribute("coords") != null) { ctx.clearRect(0, 0, tempcanvas.width, tempcanvas.height); draw(ctx, child.getAttribute("coords").split(","), "rgb(255,212,0)"); var p = ctx.getImageData(x, y, 1, 1).data;