From: Jakob Cornell Date: Mon, 7 Sep 2020 18:02:53 +0000 (-0500) Subject: Set image copy size for 50% zoom Jamboard X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d016654301ae790c89a7e63300d4ce94760ee11;p=tile-draw.git Set image copy size for 50% zoom Jamboard --- diff --git a/src/net/jcornell/tile_draw/DrawController.java b/src/net/jcornell/tile_draw/DrawController.java index 1f8ac65..d33a8bd 100644 --- a/src/net/jcornell/tile_draw/DrawController.java +++ b/src/net/jcornell/tile_draw/DrawController.java @@ -19,6 +19,8 @@ import net.jcornell.tile_draw.util.Util; public class DrawController { + protected static final int IMAGE_COPY_HEIGHT = 25; + protected final Map remaining; protected TileConfigModel currentTile; protected Random randSrc; @@ -28,8 +30,8 @@ public class DrawController { remaining = models.stream() .collect(Collectors.toMap( Function.identity(), - (TileConfigModel m) -> m.multiplicity) - ) + (TileConfigModel m) -> m.multiplicity + )) ; currentTile = null; randSrc = new Random(); @@ -37,7 +39,10 @@ public class DrawController { } public void copyTile() throws Util.ImageLoadException { - Util.copyImage(Util.extractImage(currentTile.imageFile)); + Util.copyImage( + Util.extractImage(currentTile.imageFile) + .getScaledInstance(-1, IMAGE_COPY_HEIGHT, 0) + ); } public void drawTile() {