forcegraph: fix rendering on hidpi devices
This commit is contained in:
parent
a6ad9f928a
commit
c0ab6b7406
@ -364,8 +364,13 @@ define(["d3"], function (d3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resizeCanvas() {
|
function resizeCanvas() {
|
||||||
canvas.width = el.offsetWidth
|
var r = window.devicePixelRatio
|
||||||
canvas.height = el.offsetHeight
|
canvas.width = el.offsetWidth * r
|
||||||
|
canvas.height = el.offsetHeight * r
|
||||||
|
canvas.style.width = el.offsetWidth + "px"
|
||||||
|
canvas.style.height = el.offsetHeight + "px"
|
||||||
|
ctx.resetTransform()
|
||||||
|
ctx.scale(r, r)
|
||||||
redraw()
|
redraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user