From 8d016654301ae790c89a7e63300d4ce94760ee11 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Mon, 7 Sep 2020 13:02:53 -0500 Subject: [PATCH] Set image copy size for 50% zoom Jamboard --- src/net/jcornell/tile_draw/DrawController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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() { -- 2.30.2