Skip to content

Float/int array initialization issue #8

@kukabi

Description

@kukabi

Hello.

float[] x = new float[20];
float[] y = new float[20];

translates to:

let x = new Array(20);
let y = new Array(20);

Processing (Java) initializes the float array elements to 0.0, and some Processing examples utilize the initialized array, causing the converted code to fail on NaN values. To make a complete conversion the converter needs to insert the initialization code somewhere:

x.fill(0.0);
y.fill(0.0);

Same goes for int arrays.

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