From 3e2229db2035a294cfededb63a3e8d1ee7b30817 Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Thu, 10 Feb 2022 11:10:49 +0000 Subject: [PATCH] [FIX] web: flickering in graph view Chart.js did badly compute the graph canvas container height (width) by using clientHeight (resp. clientWidth) that may be rounded up by the browser. This leads to the appearence of a useless scrollbar in the graph view and makes it flicker on some update. closes odoo/odoo#84476 X-original-commit: 6bceae94619da9f4943cbc1e58844fdbe0215802 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/lib/Chart/Chart.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/static/lib/Chart/Chart.js b/addons/web/static/lib/Chart/Chart.js index e8d937cf82c..43aef21d771 100644 --- a/addons/web/static/lib/Chart/Chart.js +++ b/addons/web/static/lib/Chart/Chart.js @@ -10745,10 +10745,10 @@ var core_helpers = function() { helpers$1.getMaximumWidth = function(domNode) { var container = helpers$1._getParentNode(domNode); if (!container) { - return domNode.clientWidth; + return domNode.getBoundingClientRect().width; // Odoo customization } - var clientWidth = container.clientWidth; + var clientWidth = container.getBoundingClientRect().width; // Odoo customization var paddingLeft = helpers$1._calculatePadding(container, 'padding-left', clientWidth); var paddingRight = helpers$1._calculatePadding(container, 'padding-right', clientWidth); @@ -10759,10 +10759,10 @@ var core_helpers = function() { helpers$1.getMaximumHeight = function(domNode) { var container = helpers$1._getParentNode(domNode); if (!container) { - return domNode.clientHeight; + return domNode.getBoundingClientRect().height; // Odoo customization } - var clientHeight = container.clientHeight; + var clientHeight = container.getBoundingClientRect().height; // Odoo customization var paddingTop = helpers$1._calculatePadding(container, 'padding-top', clientHeight); var paddingBottom = helpers$1._calculatePadding(container, 'padding-bottom', clientHeight);