Skip to content
Snippets Groups Projects
Commit 33c7c79d authored by srosse's avatar srosse
Browse files

OO-4102: add correction to the hotspot editor to be pixel exact

parent 62d6a393
No related branches found
No related tags found
No related merge requests found
Showing with 21 additions and 18 deletions
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
#end #end
jQuery(function() { jQuery(function() {
maphilightSettings.strokeWidth = 3; maphilightSettings.strokeWidth = 2;
maphilightSettings.alwaysOn = true; maphilightSettings.alwaysOn = true;
#if($r.isTrue($isResponsive)) #if($r.isTrue($isResponsive))
......
...@@ -74,12 +74,11 @@ ...@@ -74,12 +74,11 @@
width = height = "100px"; width = height = "100px";
top = left = "5px"; top = left = "5px";
} else { } else {
//var borderWidth = jQuery("#" + id).css("border-left-width");
var parts = coords.split(','); var parts = coords.split(',');
var radius = parseInt(parts[2]);//border var radius = parseInt(parts[2]);//border
width = height = (2 * radius); width = height = (2 * radius);
left = parseInt(parts[0]) - radius - 3; left = parseInt(parts[0]) - radius - 1;
top = parseInt(parts[1]) - radius - 3; top = parseInt(parts[1]) - radius - 1;
} }
var nodes = jQuery("#" + id).height(height + 'px').width(width + 'px') var nodes = jQuery("#" + id).height(height + 'px').width(width + 'px')
...@@ -110,12 +109,14 @@ ...@@ -110,12 +109,14 @@
top = left = '5px'; top = left = '5px';
} else { } else {
var parts = coords.split(','); var parts = coords.split(',');
left = parseInt(parts[0]) - 3; left = parseInt(parts[0]) - 1;
top = parseInt(parts[1]) - 3; top = parseInt(parts[1]) - 1;
width = parseInt(parts[2]) - left; width = parseInt(parts[2]) - left - 3;
height = parseInt(parts[3]) - top; height = parseInt(parts[3]) - top - 3;
} }
console.log(coords, left, top, width, height);
var nodes = jQuery("#" + id).height(height + 'px').width(width + 'px') var nodes = jQuery("#" + id).height(height + 'px').width(width + 'px')
.css('top', top + 'px').css('left', left + 'px'); .css('top', top + 'px').css('left', left + 'px');
if(this.settings.resize) { if(this.settings.resize) {
...@@ -154,7 +155,7 @@ ...@@ -154,7 +155,7 @@
var id = jQuery(spot).attr('id'); var id = jQuery(spot).attr('id');
var position = jQuery(spot).position(); var position = jQuery(spot).position();
var radius = parseInt(jQuery(spot).width(), 10) / 2; var radius = parseInt(jQuery(spot).width(), 10) / 2;
var coords = (position.left + radius) + "," + (position.top + radius) + "," + radius; var coords = (position.left + radius + 1) + "," + (position.top + radius + 1) + "," + radius;
jQuery("#" + id + "_shape").val("circle"); jQuery("#" + id + "_shape").val("circle");
jQuery("#" + id + "_coords").val(coords); jQuery("#" + id + "_coords").val(coords);
return coords; return coords;
...@@ -165,7 +166,7 @@ ...@@ -165,7 +166,7 @@
var position = jQuery(spot).position(); var position = jQuery(spot).position();
var width = parseInt(jQuery(spot).width(), 10); var width = parseInt(jQuery(spot).width(), 10);
var height = parseInt(jQuery(spot).height(), 10); var height = parseInt(jQuery(spot).height(), 10);
var coords = position.left + "," + position.top + "," + (position.left + width) + "," + (position.top + height); var coords = (position.left + 1) + "," + (position.top + 1) + "," + (position.left + width + 3) + "," + (position.top + height + 3);
jQuery("#" + id + "_shape").val("rect"); jQuery("#" + id + "_shape").val("rect");
jQuery("#" + id + "_coords").val(coords); jQuery("#" + id + "_coords").val(coords);
return coords; return coords;
......
...@@ -643,9 +643,9 @@ $o-radial-progress-percentage-danger-color : $progress-bar-danger-bg !default; ...@@ -643,9 +643,9 @@ $o-radial-progress-percentage-danger-color : $progress-bar-danger-bg !default;
$o-radial-progress-circle-info-color : $progress-bar-info-bg !default; $o-radial-progress-circle-info-color : $progress-bar-info-bg !default;
$o-radial-progress-percentage-info-color : $progress-bar-info-bg !default; $o-radial-progress-percentage-info-color : $progress-bar-info-bg !default;
/* Drawing */ /* Drawing (border cannot be change without modifications of the jquery plugin and hotspot interaction) */
$o-drawing-border-color : $brand-primary; $o-drawing-border-color : $brand-primary;
$o-drawing-border-width : 4px !default; $o-drawing-border-width : 2px !default;
/* Placeholder panels */ /* Placeholder panels */
$o-panel-placeholder-border-width : 2px !default; $o-panel-placeholder-border-width : 2px !default;
......
...@@ -48,11 +48,13 @@ a.o_chelp { ...@@ -48,11 +48,13 @@ a.o_chelp {
border: $o-drawing-border-width solid $o-drawing-border-color; border: $o-drawing-border-width solid $o-drawing-border-color;
border-radius: 50%; border-radius: 50%;
position: absolute !important; position: absolute !important;
box-sizing: border-box;
} }
.o_draw_rectangle { .o_draw_rectangle {
border: $o-drawing-border-width solid $o-drawing-border-color; border: $o-drawing-border-width solid $o-drawing-border-color;
position: absolute !important; position: absolute !important;
box-sizing: border-box;
} }
......
This diff is collapsed.
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
This diff is collapsed.
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment