forked from openlp/openlp
Buffer calls
This commit is contained in:
parent
7a05a944ef
commit
84e94058a7
@ -138,9 +138,9 @@ class Renderer:
|
|||||||
self._frame = QtGui.QPixmap(self._frame.width(), self._frame.height()) #(self._bg_frame)
|
self._frame = QtGui.QPixmap(self._frame.width(), self._frame.height()) #(self._bg_frame)
|
||||||
self._frame.fill(QtCore.Qt.transparent)
|
self._frame.fill(QtCore.Qt.transparent)
|
||||||
x, y = self._correctAlignment(self._rect, bbox)
|
x, y = self._correctAlignment(self._rect, bbox)
|
||||||
bbox = self._render_lines_unaligned(lines, False, (x, y))
|
bbox = self._render_lines_unaligned(lines, False, (x, y), True)
|
||||||
if footer_lines is not None:
|
if footer_lines is not None:
|
||||||
bbox = self._render_lines_unaligned(footer_lines, True, (self._rect_footer.left(), self._rect_footer.top()) )
|
bbox = self._render_lines_unaligned(footer_lines, True, (self._rect_footer.left(), self._rect_footer.top()), True )
|
||||||
log.debug(u'generate_frame_from_lines - Finish')
|
log.debug(u'generate_frame_from_lines - Finish')
|
||||||
return self._frame
|
return self._frame
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ class Renderer:
|
|||||||
log.error(u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign)
|
log.error(u'Invalid value for theme.VerticalAlign:%s' % self._theme.display_verticalAlign)
|
||||||
return x, y
|
return x, y
|
||||||
|
|
||||||
def _render_lines_unaligned(self, lines, footer, tlcorner=(0,0)):
|
def _render_lines_unaligned(self, lines, footer, tlcorner=(0,0), live=False):
|
||||||
"""
|
"""
|
||||||
Given a list of lines to render, render each one in turn
|
Given a list of lines to render, render each one in turn
|
||||||
(using the _render_single_line fn - which may result in going
|
(using the _render_single_line fn - which may result in going
|
||||||
@ -275,7 +275,7 @@ class Renderer:
|
|||||||
for line in lines:
|
for line in lines:
|
||||||
# render after current bottom, but at original left edge
|
# render after current bottom, but at original left edge
|
||||||
# keep track of right edge to see which is biggest
|
# keep track of right edge to see which is biggest
|
||||||
(thisx, bry) = self._render_and_wrap_single_line(line, footer, (x , bry))
|
(thisx, bry) = self._render_and_wrap_single_line(line, footer, (x , bry), live)
|
||||||
if (thisx > brx):
|
if (thisx > brx):
|
||||||
brx = thisx
|
brx = thisx
|
||||||
retval = QtCore.QRect(x, y,brx-x, bry-y)
|
retval = QtCore.QRect(x, y,brx-x, bry-y)
|
||||||
@ -287,7 +287,7 @@ class Renderer:
|
|||||||
painter.end()
|
painter.end()
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
def _render_and_wrap_single_line(self, line, footer, tlcorner=(0,0)):
|
def _render_and_wrap_single_line(self, line, footer, tlcorner=(0,0), live=False):
|
||||||
"""
|
"""
|
||||||
Render a single line of words onto the DC, top left corner
|
Render a single line of words onto the DC, top left corner
|
||||||
specified.
|
specified.
|
||||||
@ -352,29 +352,30 @@ class Renderer:
|
|||||||
elif align == 2:
|
elif align == 2:
|
||||||
x = (maxx - w) / 2;
|
x = (maxx - w) / 2;
|
||||||
rightextent = x + w
|
rightextent = x + w
|
||||||
# now draw the text, and any outlines/shadows
|
if live:
|
||||||
if self._theme.display_shadow:
|
# now draw the text, and any outlines/shadows
|
||||||
self._get_extent_and_render(line, footer, tlcorner=(x+self._shadow_offset,y+self._shadow_offset),
|
if self._theme.display_shadow:
|
||||||
draw=True, color = self._theme.display_shadow_color)
|
self._get_extent_and_render(line, footer, tlcorner=(x+self._shadow_offset,y+self._shadow_offset),
|
||||||
if self._theme.display_outline:
|
draw=True, color = self._theme.display_shadow_color)
|
||||||
self._get_extent_and_render(line, footer, (x+self._outline_offset,y), draw=True,
|
if self._theme.display_outline:
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x+self._outline_offset,y), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x, y+self._outline_offset), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x, y+self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x, y-self._outline_offset), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x, y-self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x-self._outline_offset,y), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x-self._outline_offset,y), draw=True,
|
||||||
if self._outline_offset > 1:
|
color = self._theme.display_outline_color)
|
||||||
self._get_extent_and_render(line, footer, (x+self._outline_offset,y+self._outline_offset), draw=True,
|
if self._outline_offset > 1:
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x+self._outline_offset,y+self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x-self._outline_offset,y+self._outline_offset), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x-self._outline_offset,y+self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x+self._outline_offset,y-self._outline_offset), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x+self._outline_offset,y-self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer, (x-self._outline_offset,y-self._outline_offset), draw=True,
|
color = self._theme.display_outline_color)
|
||||||
color = self._theme.display_outline_color)
|
self._get_extent_and_render(line, footer, (x-self._outline_offset,y-self._outline_offset), draw=True,
|
||||||
self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)
|
color = self._theme.display_outline_color)
|
||||||
|
self._get_extent_and_render(line, footer,tlcorner=(x, y), draw=True)
|
||||||
y += h
|
y += h
|
||||||
if linenum == 0:
|
if linenum == 0:
|
||||||
self._first_line_right_extent = rightextent
|
self._first_line_right_extent = rightextent
|
||||||
|
Loading…
Reference in New Issue
Block a user