Changeset - 2346f7b1b82a
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2015-02-19 00:00:40
madski@unity3d.com
graph: work around Firefox OS X limit of canvas size 32k when scaling
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/graph.js
Show inline comments
 
@@ -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";
0 comments (0 inline, 0 general)