Commit e597daa7 authored by Andreas Mueller's avatar Andreas Mueller

fix relative_scaling=0 issue

parent 0c3a9bbf
......@@ -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)
......@@ -404,7 +404,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