Skip to content

Commit 3927204

Browse files
committed
Fix Unholey Light weirdness when switching overlay debugging on/off
1 parent efe17d1 commit 3927204

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/src/main/java/eu/chainfire/holeylight/animation/SpritePlayer.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public interface OnAnimationListener {
8585
private final Paint paint = new Paint();
8686
private final Paint paintTsp = new Paint();
8787
private final Paint paintTspTransparent = new Paint();
88+
private final Paint paintTspTransparentDebug = new Paint();
8889
private final float dpToPx;
8990

9091
private volatile int frame = -1;
@@ -139,12 +140,9 @@ public SpritePlayer(Context context) {
139140
paintTsp.setDither(false);
140141
paintTsp.setFilterBitmap(false);
141142

142-
if (Settings.DEBUG_OVERLAY) {
143-
paintTspTransparent.setColor(0x4000FF00);
144-
} else {
145-
paintTspTransparent.setColor(Color.TRANSPARENT);
146-
paintTspTransparent.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
147-
}
143+
paintTspTransparent.setColor(Color.TRANSPARENT);
144+
paintTspTransparent.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
145+
paintTspTransparentDebug.setColor(0x4000FF00);
148146

149147
handlerRender.post(() -> {
150148
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
@@ -229,7 +227,7 @@ private boolean colorsChanged(int[] lastColors) {
229227
protected void onDraw(Canvas canvas) {
230228
if (isTSPMode() && !tspBlank && tspTransparentArea != null && SystemClock.elapsedRealtime() - modeStart > TSP_FIRST_DRAW_DELAY) {
231229
Slog.d("Clock", "performDraw");
232-
canvas.drawRect(tspTransparentArea, paintTspTransparent);
230+
canvas.drawRect(tspTransparentArea, Settings.DEBUG_OVERLAY ? paintTspTransparentDebug : paintTspTransparent);
233231
tspTransparentDrawn = true;
234232
}
235233
}

0 commit comments

Comments
 (0)