Fix panic on zero sized scissor

This commit is contained in:
João Capucho 2021-03-22 12:45:03 +00:00 committed by Avi Weinstock
parent 4c51dd0147
commit 4c73433ecb

View File

@ -667,7 +667,11 @@ impl Ui {
if intersection.is_valid() {
intersection
} else {
Aabr::new_empty(Vec2::zero())
// TODO: What should we return here
// We used to return a zero sized aabr but it's invalid to
// use a zero sized scissor so for now we just don't change
// the scissor.
current_scissor
}
};
if new_scissor != current_scissor {