Fix missing tails for bottom alignment

This commit is contained in:
Jonathan Corwin 2012-03-21 22:27:04 +00:00
parent 50f3f2c9b8
commit 6eff57d17b
2 changed files with 10 additions and 4 deletions

View File

@ -458,13 +458,18 @@ def build_lyrics_format_css(theme, width, height):
# fix tag incompatibilities
if theme.display_horizontal_align == HorizontalType.Justify:
justify = u''
if theme.display_vertical_align == VerticalType.Bottom:
padding_bottom = u'0.5em'
else:
padding_bottom = u'0'
lyrics = u'%s word-wrap: break-word; ' \
'text-align: %s; vertical-align: %s; font-family: %s; ' \
'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx;' \
'height: %spx; ' % \
(justify, align, valign, theme.font_main_name, theme.font_main_size,
theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
left_margin, width, height)
padding_bottom, left_margin, width, height)
if theme.font_main_outline:
if webkit_version() <= 534.3:
lyrics += u' letter-spacing: 1px;'

View File

@ -289,7 +289,7 @@ class Renderer(object):
def _calculate_default(self):
"""
Calculate the default dimentions of the screen.
Calculate the default dimensions of the screen.
"""
screen_size = self.screens.current[u'size']
self.width = screen_size.width()
@ -380,6 +380,7 @@ class Renderer(object):
(build_lyrics_format_css(self.theme_data, self.page_width,
self.page_height), build_lyrics_outline_css(self.theme_data))
self.web.setHtml(html)
self.empty_height = self.web_frame.contentsSize().height()
def _paginate_slide(self, lines, line_end):
"""
@ -600,7 +601,7 @@ class Renderer(object):
"""
self.web_frame.evaluateJavaScript(u'show_text("%s")' %
text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
return self.web_frame.contentsSize().height() <= self.page_height
return self.web_frame.contentsSize().height() <= self.empty_height
def _words_split(self, line):
"""