Fixed image scaling
@@ -66,7 +66,13 @@ public void onDraw(Canvas canvas) {
if (image.get() != null) {
if (ignoreAspectRatio) {
ScaleMode scaleMode = canvas.getCurrentStyle().getTextureScaleMode();
- canvas.getCurrentStyle().setTextureScaleMode(ScaleMode.STRETCH);
+ if(image.get().getWidth() > (image.get().getHeight()*2))
+ {
+ canvas.getCurrentStyle().setTextureScaleMode(scaleMode.SCALE_FIT);
+ }
+ else{
+ canvas.getCurrentStyle().setTextureScaleMode(ScaleMode.SCALE_FILL);
+ }
canvas.drawTexture(image.get(), tint.get());
canvas.getCurrentStyle().setTextureScaleMode(scaleMode);
} else {
