mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-20 07:00:16 +00:00
Refactor canvas rendering and DPI handling for improved quality and performance
This commit is contained in:
@@ -8,15 +8,17 @@ function resizeCanvas()
|
||||
{
|
||||
var adv = document.getElementById('bottom_info');
|
||||
var canvas = document.getElementById('canvas');
|
||||
canvas.width = document.getElementById('canvasSection').offsetWidth;
|
||||
let width_float = document.getElementById('canvasSection').offsetWidth;
|
||||
var mainContainer = document.getElementById('mainContainer');
|
||||
var offset = (mainContainer.offsetTop + mainContainer.offsetHeight) - (canvas.offsetTop + canvas.offsetHeight) +
|
||||
($("#footerContent").css("display") === 'block' ? 0 : 24);
|
||||
|
||||
canvas.height = $(window).height() - document.getElementById('canvas').offsetTop -
|
||||
let height_float = $(window).height() - document.getElementById('canvas').offsetTop -
|
||||
(adv && $("#bottom_info").css("display") === 'block' ? document.getElementById('bottom_info').offsetHeight : 0) -
|
||||
($("#footer").css("display") === 'block' ? document.getElementById('footer').offsetHeight : 0) - offset;
|
||||
|
||||
setDPIForCanvas(canvas, width_float, height_float);
|
||||
|
||||
editor.redraw();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user