From 9cd7dd6c98eff8d4a931e01d41172885abf82bbc Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 31 Oct 2013 08:14:14 -0700 Subject: [PATCH] fix to compile post-merge --- .../org/eehouse/android/xw4/BoardView.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java index 124a71364..3b7021089 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java @@ -415,6 +415,30 @@ public class BoardView extends View implements BoardHandler, SyncedDraw { return m_pendingScore; } + public Bitmap getScaledBoard() + { + Bitmap result = null; + if ( GitVersion.THUMBNAIL_SUPPORTED ) { + int divisor = XWPrefs.getThumbScale( m_context ); + + if ( 0 < divisor ) { + int[] dims = new int[2]; + Rect rect = new Rect(); + XwJNI.board_getActiveRect( m_jniGamePtr, rect, dims ); + + Bitmap tmpb = + Bitmap.createBitmap( s_bitmap, rect.left, rect.top, + 1 + rect.width(), 1 + rect.height() ); + + result = Bitmap.createScaledBitmap( tmpb, + rect.width() / divisor, + rect.height() / divisor, + false ); + } + } + return result; + } + private int getSpacing( MotionEvent event ) { int result;