Mercurial > 510Connectbot
diff app/src/main/java/com/five_ten_sg/connectbot/service/TerminalBridge.java @ 457:105815cce146 stable-1.9.3-3
minimum version android 5, target and compile version api 28
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 29 Jan 2019 11:21:57 -0800 |
parents | d29cce60f393 |
children |
line wrap: on
line diff
--- a/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalBridge.java Sat Nov 10 12:18:05 2018 -0800 +++ b/app/src/main/java/com/five_ten_sg/connectbot/service/TerminalBridge.java Tue Jan 29 11:21:57 2019 -0800 @@ -55,7 +55,6 @@ import android.text.ClipboardManager; import android.text.Editable; import android.text.method.CharacterPickerDialog; -import android.util.FloatMath; import android.util.Log; import android.view.KeyEvent; import android.view.View; @@ -450,11 +449,11 @@ fontSize = size; // read new metrics to get exact pixel dimensions FontMetrics fm = defaultPaint.getFontMetrics(); - charTop = (int)FloatMath.ceil(fm.top); + charTop = (int)Math.ceil(fm.top); float[] widths = new float[1]; defaultPaint.getTextWidths("X", widths); - charWidth = (int)FloatMath.ceil(widths[0]); - charHeight = (int)FloatMath.ceil(fm.descent - fm.top); + charWidth = (int)Math.ceil(widths[0]); + charHeight = (int)Math.ceil(fm.descent - fm.top); // refresh any bitmap with new font size if (parent != null) parentChanged(parent); @@ -691,7 +690,7 @@ } // Save the current clip region - canvas.save(Canvas.CLIP_SAVE_FLAG); + canvas.save(); // clear this dirty area with background color defaultPaint.setColor(bg); @@ -800,7 +799,7 @@ float[] widths = new float[1]; defaultPaint.getTextWidths("X", widths); int termWidth = (int)widths[0] * cols; - int termHeight = (int)FloatMath.ceil(fm.descent - fm.top) * rows; + int termHeight = (int)Math.ceil(fm.descent - fm.top) * rows; Log.d("fontsize", String.format("font size %f resulted in %d x %d", size, termWidth, termHeight)); // Check to see if it fits in resolution specified.