add integration tests and update README

This commit is contained in:
Nick Fisher
2023-10-12 21:48:44 +08:00
parent 80388c059d
commit 8358c0b236
32 changed files with 427 additions and 75 deletions

View File

@@ -198,9 +198,16 @@ class FilamentControllerFFI extends FilamentController {
///
@override
Future resize(int width, int height, {double scaleFactor = 1.0}) async {
if (_textureId == null) {
print("No texture created, ignoring call to resize.");
return;
}
_resizing = true;
setRendering(false);
_lib.destroy_swap_chain(_viewer!);
if (_viewer != null) {
_lib.destroy_swap_chain(_viewer!);
}
await destroyTexture();
size = ui.Size(width * _pixelRatio, height * _pixelRatio);

View File

@@ -183,6 +183,7 @@ class _FilamentWidgetState extends State<FilamentWidget> {
_resizeTimer?.cancel();
_resizeTimer = Timer(Duration(milliseconds: 500), () async {
print("Resizing to $newSize");
await widget.controller
.resize(newSize.width.toInt(), newSize.height.toInt());
WidgetsBinding.instance.addPostFrameCallback((_) async {