viewport: Simplify child allocation
authorTimm Bäder <mail@baedert.org>
Mon, 30 Oct 2017 16:47:59 +0000 (17:47 +0100)
committerTimm Bäder <mail@baedert.org>
Tue, 31 Oct 2017 09:10:53 +0000 (10:10 +0100)
allocation->x and allocation->y are always 0

gtk/gtkviewport.c

index 870f358981950b68078d701e07a6da68845a4a9c..cb47726c66b660eed3f70fe9ef8d0e2b83b9d4b6 100644 (file)
@@ -526,8 +526,8 @@ gtk_viewport_size_allocate (GtkWidget           *widget,
     {
       GtkAllocation child_allocation, child_clip;
 
-      child_allocation.x = allocation->x - gtk_adjustment_get_value (hadjustment);
-      child_allocation.y = allocation->y - gtk_adjustment_get_value (vadjustment);
+      child_allocation.x = - gtk_adjustment_get_value (hadjustment);
+      child_allocation.y = - gtk_adjustment_get_value (vadjustment);
       child_allocation.width = gtk_adjustment_get_upper (hadjustment);
       child_allocation.height = gtk_adjustment_get_upper (vadjustment);