Skip to content

Commit

Permalink
Prevent artifacts in stretched fixed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zeruth committed Apr 18, 2018
1 parent 777673b commit c65548d
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@

import com.google.common.eventbus.EventBus;
import com.google.inject.Injector;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.awt.RenderingHints;
import net.runelite.api.Actor;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
Expand Down Expand Up @@ -274,6 +275,12 @@ public static void draw(MainBufferProvider mainBufferProvider, Graphics graphics
stretchedGraphics = (Graphics2D) stretchedImage.getGraphics();

lastStretchedDimensions = stretchedDimensions;

/*
Fill Canvas before drawing stretched image to prevent artifacts.
*/
graphics.setColor(Color.BLACK);
graphics.fillRect(0, 0, client.getCanvas().getWidth(), client.getCanvas().getHeight());
}

stretchedGraphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
Expand Down

0 comments on commit c65548d

Please sign in to comment.