avoid invalid texture width and height

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-03-09 19:38:47 +08:00
parent 6734dd01c9
commit d19d4aacdb

View File

@ -371,7 +371,11 @@ class FfiModel with ChangeNotifier {
_updateSessionWidthHeight(String id) {
parent.target?.canvasModel.updateViewStyle();
bind.sessionSetSize(id: id, width: display.width, height: display.height);
if (display.width < 0 || display.height < 0) {
debugPrintStack(label: 'invalid display size (${display.width},${display.height})');
} else {
bind.sessionSetSize(id: id, width: display.width, height: display.height);
}
}
/// Handle the peer info event based on [evt].