Skip to content

Commit

Permalink
Some bounds checking on pinch-to-zoom resizes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilm0r committed Jan 25, 2013
1 parent 5c4656f commit 1080194
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/net/gaast/giggity/BlockSchedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 1080194

Please sign in to comment.