chore: add logging to ThermionTextureWidget
This commit is contained in:
@@ -68,12 +68,22 @@ class _ThermionTextureWidgetState extends State<ThermionTextureWidget> {
|
||||
var dpr = MediaQuery.of(context).devicePixelRatio;
|
||||
|
||||
var size = ((context.findRenderObject()) as RenderBox).size;
|
||||
|
||||
_logger.info(
|
||||
"Widget size in logical pixels ${size} (pixel ratio : $dpr)");
|
||||
|
||||
var width = (size.width * dpr).ceil();
|
||||
var height = (size.height * dpr).ceil();
|
||||
|
||||
_logger.info(
|
||||
"Target texture dimensions ${width}x${height} (pixel ratio : $dpr)");
|
||||
|
||||
_texture = await ThermionFlutterPlatform.instance
|
||||
.createTexture(widget.view, width, height);
|
||||
|
||||
_logger.info(
|
||||
"Actual texture dimensions ${_texture!.width}x${_texture!.height} (pixel ratio : $dpr)");
|
||||
|
||||
await widget.view.updateViewport(_texture!.width, _texture!.height);
|
||||
|
||||
try {
|
||||
@@ -177,6 +187,9 @@ class _ThermionTextureWidgetState extends State<ThermionTextureWidget> {
|
||||
var newWidth = newSize.width.ceil();
|
||||
var newHeight = newSize.height.ceil();
|
||||
|
||||
_logger.info(
|
||||
"Resizing texture to dimensions ${newWidth}x${newHeight} (pixel ratio : $dpr)");
|
||||
|
||||
await _texture?.resize(
|
||||
newWidth,
|
||||
newHeight,
|
||||
@@ -184,6 +197,9 @@ class _ThermionTextureWidgetState extends State<ThermionTextureWidget> {
|
||||
0,
|
||||
);
|
||||
|
||||
_logger.info(
|
||||
"Resized texture to dimensions ${_texture!.width}x${_texture!.height} (pixel ratio : $dpr)");
|
||||
|
||||
await widget.view.updateViewport(_texture!.width, _texture!.height);
|
||||
|
||||
await widget.onResize?.call(
|
||||
|
||||
Reference in New Issue
Block a user