Open newdev2017 opened 7 years ago
Thank you very much for your comment and your code, but I am using Chrome v57.0.2987.133 and I cannot reproduce the problem. I tried with both Windows and Linux. Maybe the problem has been fixed. Is it still happening to you with the latest version of Chrome?
zoomFit() is not working with Chrome browser. Tested on version 55.0.2883.87 m (64-bit). While it is working fine with FireFox, Tested version 51.0.1 (32-bit).
Replaced:
svg.attr('transform', 'translate(' + svgTranslate[0] + ', ' + svgTranslate[1] + ') scale(' + svgScale + ')');
with:
g.attr('transform', 'translate(' + svgTranslate[0] + ', ' + svgTranslate[1] + ') scale(' + svgScale + ')');
where
var g = svg.append("g");
and it worked !