From 108019477cebb3d13c277468d3e24c05984f6e27 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 25 Jan 2013 00:29:10 +0000 Subject: [PATCH] Some bounds checking on pinch-to-zoom resizes. --- src/net/gaast/giggity/BlockSchedule.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/gaast/giggity/BlockSchedule.java b/src/net/gaast/giggity/BlockSchedule.java index a51dd0c5..d4bd3432 100644 --- a/src/net/gaast/giggity/BlockSchedule.java +++ b/src/net/gaast/giggity/BlockSchedule.java @@ -106,11 +106,8 @@ private void draw() { Element cell; schedCont = new AbsoluteLayout(ctx); - //schedCont.setBackgroundColor(c.background); - //schedCont.setMinimumHeight(sched.getTents().size()); Bitmap bmp = Bitmap.createBitmap(HourWidth, TentHeight, Bitmap.Config.ARGB_8888); - //bmp.setHasAlpha(true); for (x = 0; x < HourWidth; x++) { for (y = 0; y < TentHeight; y ++) { if (x == HourWidth / 4 && (y & 12) > 0) @@ -226,7 +223,10 @@ public void onResizeEvent(SimpleScroller src, float scaleX, float scaleY, int sc HourWidth *= scaleX; TentHeight *= scaleY; draw(); - + + HourWidth = Math.max(60, Math.min(HourWidth, 1000)); + TentHeight = Math.max(60, Math.min(TentHeight, 400)); + SharedPreferences.Editor ed = pref.edit(); ed.putInt("block_schedule_hour_width", HourWidth); ed.putInt("block_schedule_tent_height", TentHeight);