Fix layout bug when there are no visible boxes (#8507)

This commit is contained in:
Jukka Kurkela 2021-02-24 23:27:11 +02:00 committed by GitHub
parent 692d8a4128
commit 5ab5552acb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 1 deletions

View File

@ -344,7 +344,7 @@ export default {
//
const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>
wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0);
wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;
const params = Object.freeze({
outerWidth: width,

View File

@ -0,0 +1,39 @@
module.exports = {
config: {
type: 'line',
data: {
labels: [0],
datasets: [{
data: [0],
radius: 16,
backgroundColor: 'red'
}],
},
options: {
plugins: {
legend: false,
tooltip: false,
title: false,
filler: false
},
scales: {
x: {
display: false,
offset: true
},
y: {
display: false
}
},
layout: {
padding: 16
}
}
},
options: {
canvas: {
height: 32,
width: 32
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B