Skip to content

FlutterAngleTexture.resize() on web throws an exception (with fix) #59

Description

@RobertRoeb

Currently, calling FlutterAngleTexture.resize() to resize the texture does not work on the web, apparantly because the surfaceID is not recognized as a HTMLCanvasElement. Here is the current code in lib/webgl/angle.dart

Future resize(FlutterAngleTexture texture, AngleOptions options) async {
texture.surfaceId?.width = (options.width * options.dpr).toInt();
texture.surfaceId?.height = (options.height * options.dpr).toInt();
}

Something like this seems to work:

Future resize(FlutterAngleTexture texture, AngleOptions options) async{
final element = surfaceID as html.HTMLCanvasElement;
element.width = (options.width * options.dpr).toInt();
element.height = (options.height * options.dpr).toInt();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions