Apply focus+context to avoid drawing items that are away from the current one
authorEnrico Zini <enrico@enricozini.org>
Tue, 8 Dec 2009 15:44:07 +0000 (15:44 +0000)
committerEnrico Zini <enrico@enricozini.org>
Tue, 8 Dec 2009 15:44:07 +0000 (15:44 +0000)
src/fisheye.vala

index 1d844d9f0806fdb6cde7098efdcfe5eb59fb429a..24fefeb30e91e6a380cdf570af3ea4dc89326027 100644 (file)
@@ -107,7 +107,9 @@ public class FisheyeList : Gtk.DrawingArea
 
                context.set_line_width (0.001);
                context.select_font_face("Sans", Cairo.FontSlant.NORMAL, Cairo.FontWeight.NORMAL);
-               for (int idx = 0; idx < list.length; ++idx)
+               int start = cur_el > 20 ? cur_el-20 : 0;
+               int end = cur_el < list.length - 20 ? cur_el + 20 : list.length;
+               for (int idx = start; idx < end; ++idx)
                {
                        double posprev = idx == 0 ? 0 : el_y(idx-1);
                        double pos = el_y(idx);