[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) <aab@odoo.com>
This commit is contained in:
Mathieu Duckerts-Antoine
2022-02-14 07:58:52 +00:00
parent 4484fc1e7c
commit 3e2229db20
+4 -4
View File
@@ -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);