fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

subImage() renders incorrectly on android #165

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code below renders correctly on java (win7), but not on android.
It's rendered as if y() was twice the actual value. This applies to x as well.

Tested on the latst snapshots of both playn and ooo-playn.

    final Image img = assets().getImage("images/pea.png");
    final ImageLayer layer = graphics().createImageLayer();
    graphics().rootLayer().add(layer);

    AssetWatcher assetWatcher = new AssetWatcher(new AssetWatcher.Listener() {
      @Override
      public void error(Throwable e) {
      }

      @Override
      public void done() {
        layer.setImage(img.subImage(0f, img.height() * 0.25f, img.width(), img.height() * 0.5f));
        layer.setSize(img.width(), img.height() * 0.5f);
      }
    });
    assetWatcher.add(img);
    assetWatcher.start();
  }

Original issue reported on code.google.com by daniel.s...@gmail.com on 27 Apr 2012 at 1:08

GoogleCodeExporter commented 9 years ago
Actually, the SubImageTest test illustrates the rendering issues perfectly :).

Tested on: galaxy s with 2.3.7 (cm 7.1) and nexus s with 4.0.4.

Original comment by daniel.s...@gmail.com on 1 May 2012 at 6:04

GoogleCodeExporter commented 9 years ago
Fixed as of 2f3ee2dd5eee4186a9c166361feb01f416bd2751. Awesome, thanks! :)

Original comment by daniel.s...@gmail.com on 1 May 2012 at 7:05

GoogleCodeExporter commented 9 years ago
Alas, my "Closes #165." didn't seem to auto-close this issue. I'm so glad we're 
not using Github!

Original comment by samskiv...@gmail.com on 1 May 2012 at 7:13