Skip to content

Commit

Permalink
Fixed zTransform return values
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Dec 23, 2023
1 parent 7ec3694 commit 5917728
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arc-core/src/arc/graphics/g2d/Draw.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Draw{
private static final Color[] carr = new Color[3];
private static final float[] vertices = new float[SpriteBatch.SPRITE_SIZE];
private static @Nullable FloatFloatf zTransformer;
private static float actualZ;

public static float scl = 1f;
public static float xscl = 1f, yscl = 1f;
Expand Down Expand Up @@ -151,12 +152,12 @@ public static void zTransform(){
}

public static float z(){
return batch.sortAscending ? batch.z : -batch.z;
return actualZ;
}

/** Note that this does nothing on most Batch implementations. */
public static void z(float z){
Core.batch.z(zTransformer == null ? z : zTransformer.get(z));
Core.batch.z(zTransformer == null ? actualZ = z : zTransformer.get(actualZ = z));
}

public static Color getColor(){
Expand Down

0 comments on commit 5917728

Please sign in to comment.