Set image copy size for 50% zoom Jamboard
authorJakob Cornell <jakob+gpg@jcornell.net>
Mon, 7 Sep 2020 18:02:53 +0000 (13:02 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Mon, 7 Sep 2020 18:02:53 +0000 (13:02 -0500)
src/net/jcornell/tile_draw/DrawController.java

index 1f8ac654afaf5ee9babaae14ac47e5bd2b08ee2f..d33a8bde2e590b8e0b8331e3284ca7bbbadd382e 100644 (file)
@@ -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<TileConfigModel, Integer> 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() {