From 09d3dd13d6632bb3cc9b5df9f0da1fb9d42d7ca2 Mon Sep 17 00:00:00 2001 From: reger Date: Thu, 24 Dec 2015 19:39:37 +0100 Subject: [PATCH] limit bookmark tag cloud font-size to 2.0em --- htroot/Bookmarks.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java index a5a4b3342..905787de4 100644 --- a/htroot/Bookmarks.java +++ b/htroot/Bookmarks.java @@ -76,6 +76,9 @@ public class Bookmarks { final static boolean TAGS = false; final static boolean FOLDERS = true; + final static float TAGCLOUD_FONTSIZE_MIN = 0.75f; // min font-size in em + final static float TAGCLOUD_FONTSIZE_MAX = 2.0f; // max font-size in em + public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) { int max_count = 10; @@ -455,7 +458,7 @@ public class Bookmarks { } } else { // font-size is pseudo-rounded to 2 decimals - prop.put("display_"+id+"_"+count+"_size", Math.round((1.1f+Math.log(tag.size())/4f)*100.0f)/100.0f); + prop.put("display_"+id+"_"+count+"_size", Math.min(TAGCLOUD_FONTSIZE_MAX, Math.round((TAGCLOUD_FONTSIZE_MIN + Math.log(tag.size())/4f)*100.0f)/100.0f)); } count++; }