Table: reset dimensions. (#396)

The table is not meant to be used to render more than once. Reset the
dimensions so that, even if it is used wrongly, this is not memory
unsafe.

This was raised by:
https://github.com/ArthurSonzogni/FTXUI/issues/381
This commit is contained in:
Arthur Sonzogni 2022-05-08 08:34:51 +02:00 committed by GitHub
parent 09a2c077eb
commit a6e04b4346
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,6 +174,8 @@ Element Table::Render() {
it = std::move(it) | size(WIDTH, EQUAL, 0) | size(HEIGHT, EQUAL, 0);
}
}
dim_x_ = 0;
dim_y_ = 0;
return gridbox(std::move(elements_));
}