All: fix zoomToBox to make use of grChipOffsetX/Y (tested on all chips)

This commit is contained in:
David Banks 2018-10-14 13:07:25 +01:00
parent a4ed7a9178
commit 8e799d6922
1 changed files with 2 additions and 2 deletions

View File

@ -204,8 +204,8 @@ function ctxDrawBox(ctx, xMin, yMin, xMax, yMax){
function zoomToBox(xmin,xmax,ymin,ymax){
var xmid=(xmin+xmax)/2;
var ymid=(ymin+ymax)/2;
var x=(xmid+400)/grChipSize*600;
var y=600-ymid/grChipSize*600;
var x=(xmid+grChipOffsetX)/grChipSize*600;
var y=600-(ymid-grChipOffsetY)/grChipSize*600;
var zoom=5; // pending a more careful calculation
moveHere([x,y,zoom]);
}