Skip to content

Commit

Permalink
SvgNest.load(): Return placed/total separately in callback
Browse files Browse the repository at this point in the history
The '44/88' pars string is a UI thing, should be in UI code
  • Loading branch information
jonnor committed Aug 4, 2017
1 parent c88dc4d commit 65a3088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@

var iterations = 0;

function renderSvg(svglist, efficiency, numplaced){
function renderSvg(svglist, efficiency, placed, total){
iterations++;
document.getElementById('info_iterations').innerHTML = iterations;

Expand All @@ -458,8 +458,8 @@
if(efficiency || efficiency === 0){
document.getElementById('info_efficiency').innerHTML = Math.round(efficiency*100);
}
document.getElementById('info_placed').innerHTML = numplaced;

document.getElementById('info_placed').innerHTML = placed+'/'+total;

document.getElementById('info_placement').setAttribute('style','display: block');
display.setAttribute('style','display: none');
Expand Down
2 changes: 1 addition & 1 deletion svgnest.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@
numPlacedParts++;
}
}
displayCallback(self.applyPlacement(best.placements), placedArea/totalArea, numPlacedParts+'/'+numParts);
displayCallback(self.applyPlacement(best.placements), placedArea/totalArea, numPlacedParts, numParts);
}
else{
displayCallback();
Expand Down

0 comments on commit 65a3088

Please sign in to comment.