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,8 +371,12 @@ class FfiModel with ChangeNotifier {
_updateSessionWidthHeight(String id) { _updateSessionWidthHeight(String id) {
parent.target?.canvasModel.updateViewStyle(); parent.target?.canvasModel.updateViewStyle();
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); bind.sessionSetSize(id: id, width: display.width, height: display.height);
} }
}
/// Handle the peer info event based on [evt]. /// Handle the peer info event based on [evt].
handlePeerInfo(Map<String, dynamic> evt, String peerId) async { handlePeerInfo(Map<String, dynamic> evt, String peerId) async {