Skip to content
Snippets Groups Projects
Unverified Commit 6da418f5 authored by xgui3783's avatar xgui3783 Committed by GitHub
Browse files

Merge pull request #850 from HumanBrainProject/bugfix_dpr

[bugfix] high DPR screenshot
parents 5fbb59bc 289eb222
No related branches found
No related tags found
No related merge requests found
......@@ -128,11 +128,10 @@ import { AtlasCmptConnModule } from "src/atlasComponents/connectivity";
})
}
const { x, y, width, height } = param
const { devicePixelRatio: dpr } = window
return new Promise(rs => {
const subCanvas = document.createElement('canvas')
subCanvas.width = width * dpr
subCanvas.height = height * dpr
subCanvas.width = width
subCanvas.height = height
const context = subCanvas.getContext('2d')
context.drawImage(
canvas,
......@@ -140,18 +139,18 @@ import { AtlasCmptConnModule } from "src/atlasComponents/connectivity";
/**
* from
*/
x * dpr,
y * dpr,
width * dpr,
height * dpr,
x,
y,
width,
height,
/**
* to
*/
0,
0,
width * dpr,
height * dpr
width,
height
)
subCanvas.toBlob(blob => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment