# HG changeset patch # User Mads Kiilerich # Date 2015-02-19 00:00:40 # Node ID 2346f7b1b82a1b1ba98c9bd5635801a1f672a247 # Parent a0443f20a5ecdc7ce29aee252f53fa67e8432625 graph: work around Firefox OS X limit of canvas size 32k when scaling diff --git a/kallithea/public/js/graph.js b/kallithea/public/js/graph.js --- a/kallithea/public/js/graph.js +++ b/kallithea/public/js/graph.js @@ -68,8 +68,9 @@ function BranchRenderer(canvas_id, conte this.canvas.setAttribute('width',canvasWidth); this.canvas.setAttribute('height',content.clientHeight); - // retina version needs to be scaled by 2x then halved via css - if (window.devicePixelRatio) { + // HiDPI version needs to be scaled by 2x then halved via css + // Note: Firefox on OS X fails scaling if the canvas height is more than 32k + if (window.devicePixelRatio && content.clientHeight * window.devicePixelRatio < 32768) { this.canvas.setAttribute('width', canvasWidth * window.devicePixelRatio); this.canvas.setAttribute('height', content.clientHeight * window.devicePixelRatio); this.canvas.style.width = canvasWidth + "px";