diff --git a/MyTimeline.py b/MyTimeline.py index bd32c48..7d9b929 100644 --- a/MyTimeline.py +++ b/MyTimeline.py @@ -542,9 +542,8 @@ class MyTimelineView(NavigationView): ) layout.set_text(str(year), -1) - (x_bearing, y_bearing, text_width, text_height, x_advance, y_advance) = layout.get_extents() - text_width = text_width / Pango.SCALE - text_height = text_height / Pango.SCALE + # Get text size in pixels + text_width, text_height = layout.get_pixel_size() context.set_source_rgb(0.0, 0.0, 0.0) # Black context.move_to(timeline_x - 20 - text_width, y_pos - text_height / 2)