Skip to content

Commit

Permalink
Revert rowsize calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Jun 14, 2024
1 parent a98f222 commit f1e1946
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
### Fixed

- Only dimension on size (+ color) wrongly displayed as treemap, not tablechart.
- When markers size is factorisable to 2 numbers product on a tablechart, and the multipliers ratio is less than 16/9,
the area fully filled with equal marker rectangles.


## [0.11.1] - 2024-05-31

Expand Down
15 changes: 2 additions & 13 deletions src/chart/speclayout/tablechart.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,8 @@ void TableChart::setupVector(std::vector<Item> &items,

if (size == 0) return;

ssize_t rowsize{1};
if (!singleColumn) {
rowsize = static_cast<ssize_t>(ceil(sqrt(size)));
auto sq = static_cast<ssize_t>(ceil(sqrt(
16.0 * static_cast<double>(rowsize * rowsize) / 9.0)));

auto rem = rowsize - 1 - (size - 1) % rowsize;
for (auto i = rowsize + 1; rem > 0 && i < sq; ++i)
if (auto newRem = i - 1 - (size - 1) % i; newRem < rem) {
rowsize = i;
rem = newRem;
}
}
auto rowsize =
singleColumn ? 1 : static_cast<ssize_t>(ceil(sqrt(size)));
auto colsize = ceil(
static_cast<double>(size) / static_cast<double>(rowsize));

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/test_cases/test_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -2930,7 +2930,7 @@
"refs": ["ad12fd0"]
},
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/07a_d-w_rec_Ve2_1c": {
"refs": ["1fb2de3"]
"refs": ["e41ffd7"]
},
"ww_noFade/wNoFade_cases/2_des_pol-without/rectangle_Ve1/07a_d-w_rec_Ve2_2c": {
"refs": ["fe75086"]
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tests/fixes.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"refs": ["05d387c"]
},
"540": {
"refs": ["5aa8779"]
"refs": ["97cc5bb"]
},
"32303048": {
"refs": ["b5d95ea"]
Expand Down

0 comments on commit f1e1946

Please sign in to comment.