maphilight
maphilight copied to clipboard
circles being auto resized (shrunken) over time
We have noticed a problem where as the user is entering + saving new circle locations the coordinates are actually being changed until the circle reduces into such a small overlay it isn't clickable any longer nor editable. Easiest way to reproduce is simply select circle and click on TARGET property. Problem relates to radius calculation. There is a 1 pixel difference after saving because of rounding operation. If drawn circle has odd width, for example 95px, radius will be calculated as: 95/2 = 47.5 => 47px. If this was single isolated reduction/resize it would be ok, but when adding 30 circle overlays, by the time you get to the end of adding/saving the first ones are pin points!! FILE: imgmap/jscripts/imgmap.js
Fix attempted: if (area.shape == 'circle') { width = parseInt(area.style.width, 10);
-
var radius = Math.floor(width/2) - 1;
-
var radius = Math.max(Math.floor(width/2) - 1, 0);
else if (this.areas[id].shape == 'circle') {
-
var radius = Math.floor(width/2) - 1;
-
var radius = Math.floor(width/2);
if ((width + (diff)) - 1 > 0) { //real resize right this.areas[this.currentid].style.top = (top + (-1* diff/2)) + 'px';
-
this.setAreaSize(this.currentid, (width + (diff)) - 1, (height + (diff)));
-
this.setAreaSize(this.currentid, (width + (diff)) - 1, (height + (diff)) - 1);