return log[3] / pango.SCALE + 2
+class Rectangle:
+ def __init__(self, x, y, width, height):
+ self.x = x
+ self.y = y
+ self.width = width
+ self.height = height
+
+
class Line:
HEIGHT = 15
def build_line_list(self, x, y, width, left_margin):
self.initialize()
- line = Line(0, 0, gtk.gdk.Rectangle(
+ line = Line(0, 0, Rectangle(
x, y, width - x,
get_approximate_char_height(self.pango_layout.get_context())))
self.line_list.append(line)
if current_line_x + current_line_width + ch_w > width:
line = Line(
current_line_start_index, index,
- gtk.gdk.Rectangle(
+ Rectangle(
current_line_x, current_line_y,
current_line_width, ch_h))
self.line_list.append(line)
if current_line_start_index < len(self.text):
line = Line(current_line_start_index, len(self.text),
- gtk.gdk.Rectangle(current_line_x,
+ Rectangle(current_line_x,
current_line_y,
current_line_width,
ch_h))
pango_layout.set_text(u_text)
pango_layout.set_attributes(attrs)
drawingarea.window.draw_layout(
- gc, line.rectangle.x, line.rectangle.y + y_offset,
+ gc, int(line.rectangle.x), line.rectangle.y + y_offset,
pango_layout)