Skip to content

LoadShape fails for some svgs in Android mode #542

Open
@phanirithvij

Description

@phanirithvij

When I use loadShape with some SVGs it's not rendering properly in Android mode.
But it's getting rendered correctly in the java mode.
This is one such svg
kiwi

But this svg is getting rendered correctly.
orange-svg
I've put together this simple code that demos what I mean.

PShape svg;
int num = 1;

String[] assets = {
  "tomato.svg", "ogears.svg", "watermelon.svg", "kiwi.svg"
};

void settings() {
  size(displayWidth, displayHeight);
}

void setup(){
  svg = loadShape(assets[num]);
}

void draw(){
  background(255);
  push();
  scale(map(mouseY, 0, height, 0, 1));
  shape(svg);

  push();
  noFill();
  stroke(0);
  strokeWeight(1);
  rect(0, 0, svg.width, svg.height);
  pop();

  pop();
}

void push(){
  pushMatrix();
  pushStyle();
}

void pop(){
  popStyle();
  popMatrix();
}

void mousePressed(){
  num++;
  num = num % 4;
  svg = loadShape(assets[num]);
}

A simple project file which can be opened with processing
SVGTests.zip

And it is not working even when I use size(.., .., P2D).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions