add stub method for resizeWebCanvas to make pub.dev happy
This commit is contained in:
@@ -221,8 +221,11 @@ extension DartBigIntExtension on int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension Float32ListExtension on Float32List {
|
extension Float32ListExtension on Float32List {
|
||||||
|
|
||||||
Uint8List asUint8List() {
|
Uint8List asUint8List() {
|
||||||
return this.buffer.asUint8List(this.offsetInBytes);
|
return this.buffer.asUint8List(this.offsetInBytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void resizeWebCanvas(int width, int height) {
|
||||||
|
throw UnsupportedError("Not supported on non-web platforms");
|
||||||
|
}
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ extension Uint8ListExtension on Uint8List {
|
|||||||
|
|
||||||
extension Float32ListExtension on Float32List {
|
extension Float32ListExtension on Float32List {
|
||||||
Pointer<Float32> get address {
|
Pointer<Float32> get address {
|
||||||
|
|
||||||
final ptr = getPointer<Float32>(this, this.toJS);
|
final ptr = getPointer<Float32>(this, this.toJS);
|
||||||
final bar =
|
final bar =
|
||||||
Float32ArrayWrapper(NativeLibrary.instance.HEAPU8.buffer, ptr, length)
|
Float32ArrayWrapper(NativeLibrary.instance.HEAPU8.buffer, ptr, length)
|
||||||
@@ -167,7 +166,8 @@ extension Float32ListExtension on Float32List {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Uint8List asUint8List() {
|
Uint8List asUint8List() {
|
||||||
var ptr = Pointer<Uint8>(_NativeLibrary.instance._emscripten_get_byte_offset(this.toJS));
|
var ptr = Pointer<Uint8>(
|
||||||
|
_NativeLibrary.instance._emscripten_get_byte_offset(this.toJS));
|
||||||
return ptr.asTypedList(length * 4);
|
return ptr.asTypedList(length * 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -468,3 +468,7 @@ void stackRestore(Pointer ptr) =>
|
|||||||
void getStackFree() {
|
void getStackFree() {
|
||||||
print(_NativeLibrary.instance._emscripten_stack_get_free());
|
print(_NativeLibrary.instance._emscripten_stack_get_free());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void resizeWebCanvas(int width, int height) {
|
||||||
|
Thermion_resizeCanvas(width, height);
|
||||||
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class ThermionFlutterWebPlugin extends ThermionFlutterPlatform {
|
|||||||
///
|
///
|
||||||
void resizeCanvas(double width, double height) async {
|
void resizeCanvas(double width, double height) async {
|
||||||
_logger.info("Resizing canvas to ${width}x${height}");
|
_logger.info("Resizing canvas to ${width}x${height}");
|
||||||
Thermion_resizeCanvas((window.devicePixelRatio * width).ceil(),
|
resizeWebCanvas((window.devicePixelRatio * width).ceil(),
|
||||||
(window.devicePixelRatio * height).ceil());
|
(window.devicePixelRatio * height).ceil());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user