fix: bad_alloc if canvas element size is negative
This commit is contained in:
parent
3a999c6b19
commit
7c74eece99
@ -22,6 +22,6 @@ void gui::Canvas::draw(const DrawContext& pctx, const Assets& assets) {
|
|||||||
|
|
||||||
void gui::Canvas::setSize(const glm::vec2& size) {
|
void gui::Canvas::setSize(const glm::vec2& size) {
|
||||||
UINode::setSize(size);
|
UINode::setSize(size);
|
||||||
data->extend(size.x, size.y);
|
data->extend(std::max<int>(1, size.x), std::max<int>(1, size.y));
|
||||||
texture->reload(*data);
|
texture->reload(*data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user