[gimp] app: Fix magic number in gimp_canvas_draw_segments()



commit fc35ec4fe5a6157f1633e9d616ad36197e484084
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Mar 3 17:35:50 2010 +0100

    app: Fix magic number in gimp_canvas_draw_segments()

 app/display/gimpcanvas.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimpcanvas.c b/app/display/gimpcanvas.c
index 3f65b5e..2361e11 100644
--- a/app/display/gimpcanvas.c
+++ b/app/display/gimpcanvas.c
@@ -37,6 +37,9 @@
 #include "gimp-intl.h"
 
 
+#define MAX_BATCH_SIZE 32000
+
+
 enum
 {
   PROP_0,
@@ -786,13 +789,13 @@ gimp_canvas_draw_segments (GimpCanvas      *canvas,
   if (! gimp_canvas_ensure_style (canvas, style))
     return;
 
-  while (num_segments >= 32000)
+  while (num_segments >= MAX_BATCH_SIZE)
     {
       gdk_draw_segments (gtk_widget_get_window (GTK_WIDGET (canvas)),
                          canvas->gc[style],
-                         segments, 32000);
-      num_segments -= 32000;
-      segments     += 32000;
+                         segments, MAX_BATCH_SIZE);
+      num_segments -= MAX_BATCH_SIZE;
+      segments     += MAX_BATCH_SIZE;
     }
 
   gdk_draw_segments (gtk_widget_get_window (GTK_WIDGET (canvas)),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]