From 418d6fa9e18f34cbc5cd3fa669a27f0cfb1b20c5 Mon Sep 17 00:00:00 2001 From: polesye Date: Wed, 11 Dec 2013 15:20:05 +0200 Subject: [PATCH] BLD-413: Add rounding of coordinates. --- common/lib/xmodule/xmodule/js/src/capa/imageinput.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/capa/imageinput.js b/common/lib/xmodule/xmodule/js/src/capa/imageinput.js index d728c0522d..44910ff888 100644 --- a/common/lib/xmodule/xmodule/js/src/capa/imageinput.js +++ b/common/lib/xmodule/xmodule/js/src/capa/imageinput.js @@ -11,10 +11,10 @@ window.image_input_click = function(id,event){ iidiv = document.getElementById("imageinput_"+id); pos_x = event.offsetX?(event.offsetX):event.pageX-iidiv.offsetLeft; pos_y = event.offsetY?(event.offsetY):event.pageY-iidiv.offsetTop; - result = "[" + pos_x + "," + pos_y + "]"; + result = "[" + Math.round(pos_x) + "," + Math.round(pos_y) + "]"; cx = (pos_x-15) +"px"; - cy = (pos_y-15) +"px" ; - // alert(result); + cy = (pos_y-15) +"px"; + document.getElementById("cross_"+id).style.left = cx; document.getElementById("cross_"+id).style.top = cy; document.getElementById("cross_"+id).style.visibility = "visible" ;