Skip to content

Commit

Permalink
fix: skip resize when rendering at 640x360
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Jan 18, 2024
1 parent ad75a3c commit 7e0097d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public Screenshot(int resizeWidth, int resizeHeight) {
return this.resizeBuffer; // no data
}

if (this.width == this.resizeWidth && this.height == this.resizeHeight) {
// Only do the Y flip
for (int y = 0; y < this.height - 1; y++) {
this.resizeBuffer.put((this.height - 1 - y) * this.width * 3, this.buffer, y * this.width * 3, this.width * 3);
}
return this.resizeBuffer;
}

final double wr = (double) this.width / this.resizeWidth;
final double hr = (double) this.height / this.resizeHeight;
for (int y = 0; y < this.resizeHeight; y++) {
Expand Down

0 comments on commit 7e0097d

Please sign in to comment.