Commit 4fc252d9 authored by Andreas Mueller's avatar Andreas Mueller Committed by GitHub

Merge pull request #199 from amueller/relative_scaling_integer

fix relative_scaling=0 issue
parents 33b97e19 e597daa7
......@@ -230,3 +230,9 @@ def test_generate_from_frequencies():
result = wc.generate_from_frequencies(words)
assert_true(isinstance(result, WordCloud))
def test_relative_scaling_zero():
# non-regression test for non-integer font size
wc = WordCloud(relative_scaling=0)
wc.generate(THIS)
......@@ -407,7 +407,7 @@ class WordCloud(object):
max_font_size=self.height)
# find font sizes
sizes = [x[1] for x in self.layout_]
font_size = 2 * sizes[0] * sizes[1] / (sizes[0] + sizes[1])
font_size = int(2 * sizes[0] * sizes[1] / (sizes[0] + sizes[1]))
else:
font_size = max_font_size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment