Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_setElementRect(canvas, context, rect) {
let canvasScale = Dygraph.getContextPixelRatio(context);
canvas.style.top = `${rect.y}px`;
canvas.style.left = `${rect.x}px`;
canvas.width = rect.w * canvasScale;
canvas.height = rect.h * canvasScale;
canvas.style.width = `${rect.w}px`;
canvas.style.height = `${rect.h}px`;
if (canvasScale !== 1) {
context.scale(canvasScale, canvasScale);
}
}
_setElementRect(canvas, context, rect) {
let canvasScale = Dygraph.getContextPixelRatio(context);
canvas.style.top = `${rect.y}px`;
canvas.style.left = `${rect.x}px`;
canvas.width = rect.w * canvasScale;
canvas.height = rect.h * canvasScale;
canvas.style.width = `${rect.w}px`;
canvas.style.height = `${rect.h}px`;
if (canvasScale !== 1) {
context.scale(canvasScale, canvasScale);
}
}