[-] BO : FixBug #PSCSX-84 Fix image mapping position
This commit is contained in:
1 parent
807183b1c5
commit
a2340079c1
1 file changed
+5
-5
@@ -81,10 +81,10 @@ function editThisZone(aInFixedZoneElement) {
|
|||||||
$fixedZoneElement = $(aInFixedZoneElement).parent();
|
$fixedZoneElement = $(aInFixedZoneElement).parent();
|
||||||
var x1 = $fixedZoneElement.css('margin-left');
|
var x1 = $fixedZoneElement.css('margin-left');
|
||||||
x1 = x1.substring(0,x1.indexOf('px'));
|
x1 = x1.substring(0,x1.indexOf('px'));
|
||||||
x1 = parseInt(x1);
|
x1 = parseInt(x1)-parseInt($('#large_scene_image').css('margin-left').replace('px', ''));
|
||||||
var y1 = $fixedZoneElement.css('margin-top');
|
var y1 = $fixedZoneElement.css('margin-top');
|
||||||
y1 = y1.substring(0,y1.indexOf('px'));
|
y1 = y1.substring(0,y1.indexOf('px'));
|
||||||
y1 = parseInt(y1);
|
y1 = parseInt(y1)-parseInt($('#large_scene_image').css('margin-top').replace('px', ''));
|
||||||
var width = $fixedZoneElement.css('width');
|
var width = $fixedZoneElement.css('width');
|
||||||
width = width.substring(0,width.indexOf('px'));
|
width = width.substring(0,width.indexOf('px'));
|
||||||
var x2 = x1 + parseInt(width);
|
var x2 = x1 + parseInt(width);
|
||||||
@@ -105,7 +105,6 @@ function editThisZone(aInFixedZoneElement) {
|
|||||||
|
|
||||||
$('#product_autocomplete_input').val( $fixedZoneElement.find('p').text() );
|
$('#product_autocomplete_input').val( $fixedZoneElement.find('p').text() );
|
||||||
showAutocompleteBox(x1, y1+parseInt(height));
|
showAutocompleteBox(x1, y1+parseInt(height));
|
||||||
|
|
||||||
$('#large_scene_image').imgAreaSelect({ x1: x1, y1: y1, x2: x2, y2: y2 });
|
$('#large_scene_image').imgAreaSelect({ x1: x1, y1: y1, x2: x2, y2: y2 });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,10 +130,11 @@ function afterTextInserted (event, data, formatted) {
|
|||||||
zoneCurrent++;
|
zoneCurrent++;
|
||||||
var idProduct = data[1];
|
var idProduct = data[1];
|
||||||
var nameProduct = data[0];
|
var nameProduct = data[0];
|
||||||
var x1 = selectionCurrent.x1;
|
var x1 = parseInt($('#large_scene_image').css('margin-left').replace('px', '')) + selectionCurrent.x1;
|
||||||
var y1 = selectionCurrent.y1;
|
var y1 = parseInt($('#large_scene_image').css('margin-top').replace('px', '')) + selectionCurrent.y1;
|
||||||
var width = selectionCurrent.width;
|
var width = selectionCurrent.width;
|
||||||
var height = selectionCurrent.height;
|
var height = selectionCurrent.height;
|
||||||
|
|
||||||
addProduct(zoneCurrent, x1, y1, width, height, idProduct, nameProduct);
|
addProduct(zoneCurrent, x1, y1, width, height, idProduct, nameProduct);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user