mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
Check graph area is positive. (#625)
Bug:https://github.com/ArthurSonzogni/FTXUI/issues/624
This commit is contained in:
parent
1a7a550bfe
commit
debcbc668c
@ -39,6 +39,9 @@ class Graph : public Node {
|
|||||||
void Render(Screen& screen) override {
|
void Render(Screen& screen) override {
|
||||||
const int width = (box_.x_max - box_.x_min + 1) * 2;
|
const int width = (box_.x_max - box_.x_min + 1) * 2;
|
||||||
const int height = (box_.y_max - box_.y_min + 1) * 2;
|
const int height = (box_.y_max - box_.y_min + 1) * 2;
|
||||||
|
if (width <= 0 || height <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto data = graph_function_(width, height);
|
auto data = graph_function_(width, height);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (int x = box_.x_min; x <= box_.x_max; ++x) {
|
for (int x = box_.x_min; x <= box_.x_max; ++x) {
|
||||||
|
Loading…
Reference in New Issue
Block a user