Skip to content

Commit

Permalink
fix screen bug
Browse files Browse the repository at this point in the history
  • Loading branch information
srcimon committed Jun 30, 2023
1 parent 48b26ca commit bb808b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.github.srcimon.screwbox.core.Time;
import io.github.srcimon.screwbox.core.assets.Asset;
import io.github.srcimon.screwbox.core.graphics.*;
import io.github.srcimon.screwbox.core.graphics.Color;
import io.github.srcimon.screwbox.core.window.internal.WindowFrame;

import java.awt.*;
Expand Down Expand Up @@ -48,11 +49,11 @@ public void updateScreen(final boolean antialiased) {
graphics.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
graphics.setRenderingHint(KEY_TEXT_ANTIALIASING, VALUE_TEXT_ANTIALIAS_ON);
}
fillWith(io.github.srcimon.screwbox.core.graphics.Color.BLACK);
fillWith(Color.BLACK);
}

@Override
public void fillWith(final io.github.srcimon.screwbox.core.graphics.Color color) {
public void fillWith(final Color color) {
applyNewColor(color);
graphics.fillRect(0, 0, frame.getWidth(), frame.getHeight());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public Screen fillWith(final Offset offset, final Sprite sprite, final double sc
final long offsetX = offset.x() % spriteWidth - spriteWidth;
final long offsetY = offset.y() % spriteHeight - spriteHeight;

for (long x = 0; x <= countX; x++) {
for (long y = 0; y <= countY; y++) {
for (long x = 0; x <= countX + 1; x++) {
for (long y = 0; y <= countY + 1; y++) {
final Offset thisOffset = Offset.at((double) x * spriteWidth + offsetX, (double) y * spriteHeight + offsetY);
drawSprite(sprite, thisOffset, scale, opacity, Angle.none(), Flip.NONE, null);
}
Expand Down

0 comments on commit bb808b8

Please sign in to comment.