changeset 191:2e4ab8c33851

use floating point font size, change size by scaling factor rather than linear addition
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 16:32:28 -0700
parents dfdbc75cd45f
children f0b9ea35711a
files src/com/five_ten_sg/connectbot/service/TerminalBridge.java
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Wed Jul 02 16:23:21 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/service/TerminalBridge.java	Wed Jul 02 16:32:28 2014 -0700
@@ -448,10 +448,9 @@
      * Request a different font size. Will make call to parentChanged() to make
      * sure we resize PTY if needed.
      */
-    /* package */ final void setFontSize(float size) {
-        if (size <= 0.0)
-            return;
-
+    final void setFontSize(float size) {
+        if (size <= 0.0) return;
+        size = (float)(int)((size * 10.0f) + 0.5f) / 10.0f;
         defaultPaint.setTextSize(size);
         fontSize = size;
         // read new metrics to get exact pixel dimensions