pull/3122/head
Andrew Bauer 2021-01-02 12:06:02 -06:00 committed by Isaac Connor
parent b95f1baa96
commit 6f78b5a105
1 changed files with 19 additions and 20 deletions

View File

@ -294,7 +294,6 @@ function updateZoneImage() {
var style = imageFrame.currentStyle || window.getComputedStyle(imageFrame); var style = imageFrame.currentStyle || window.getComputedStyle(imageFrame);
var padding_left = parseInt(style.paddingLeft); var padding_left = parseInt(style.paddingLeft);
var padding_right = parseInt(style.paddingRight); var padding_right = parseInt(style.paddingRight);
var scale = (imageFrame.clientWidth - ( padding_left + padding_right )) / maxX;
var SVG = document.getElementById('zoneSVG'); var SVG = document.getElementById('zoneSVG');
var Poly = document.getElementById('zonePoly'); var Poly = document.getElementById('zonePoly');
Poly.points.clear(); Poly.points.clear();
@ -456,16 +455,16 @@ function drawZonePoints() {
top: ((parseInt(coord.y * scale)) + padding_top) +"px" top: ((parseInt(coord.y * scale)) + padding_top) +"px"
}); });
div.mouseover(highlightOn.bind(i,i)); div.mouseover(highlightOn.bind(i, i));
div.mouseout(highlightOff.bind(i,i)); div.mouseout(highlightOff.bind(i, i));
$j('#imageFrame').append(div); $j('#imageFrame').append(div);
div.draggable({ div.draggable({
'containment': imageFrame, 'containment': imageFrame,
'start': setActivePoint.bind(i,i), 'start': setActivePoint.bind(i, i),
'stop': fixActivePoint.bind(i,i), 'stop': fixActivePoint.bind(i, i),
'drag': updateActivePoint.bind(i,i) 'drag': updateActivePoint.bind(i, i)
}); });
}); // end $j.each point }); // end $j.each point
@ -477,8 +476,8 @@ function drawZonePoints() {
for ( var i = 0; i < zone['Points'].length; i++ ) { for ( var i = 0; i < zone['Points'].length; i++ ) {
var row = document.createElement('tr'); var row = document.createElement('tr');
row.id = 'row'+i; row.id = 'row'+i;
row.addEvent('mouseover', highlightOn.bind(i,i)); row.addEvent('mouseover', highlightOn.bind(i, i));
row.addEvent('mouseout', highlightOff.bind(i,i)); row.addEvent('mouseout', highlightOff.bind(i, i));
var cell = document.createElement('td'); var cell = document.createElement('td');
$j(cell).text(i+1).appendTo(row); $j(cell).text(i+1).appendTo(row);
@ -520,7 +519,7 @@ function drawZonePoints() {
$j(pbtn) $j(pbtn)
.attr('type', 'button') .attr('type', 'button')
.text('+') .text('+')
.click(addPoint.bind(i,i)) .click(addPoint.bind(i, i))
.appendTo(cell); .appendTo(cell);
if ( zone['Points'].length > 3 ) { if ( zone['Points'].length > 3 ) {
@ -530,7 +529,7 @@ function drawZonePoints() {
.attr('type', 'button') .attr('type', 'button')
.addClass('ml-1') .addClass('ml-1')
.text('-') .text('-')
.click(delPoint.bind(i,i)) .click(delPoint.bind(i, i))
.appendTo(cell); .appendTo(cell);
} }
$j(cell).appendTo(row); $j(cell).appendTo(row);