[libshumate] view: Set overflow to HIDDEN



commit cd0ab72a3c257f67ca85a564fb00907b1f0f6293
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Mar 2 20:45:03 2021 -0300

    view: Set overflow to HIDDEN
    
    Layers can, on various circumstances, try and draw outside their
    boundaries. We should not allow that.
    
    Set the overflow to HIDDEN on ShumateView itself. Remove the HIDDEN
    overflow from ShumateMapLayer too, since OpenGL clipping isn't super
    cheap, and ShumateView already takes care of it.

 shumate/shumate-map-layer.c | 3 ---
 shumate/shumate-view.c      | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/shumate/shumate-map-layer.c b/shumate/shumate-map-layer.c
index e6d8659..682ebb2 100644
--- a/shumate/shumate-map-layer.c
+++ b/shumate/shumate-map-layer.c
@@ -444,9 +444,6 @@ shumate_map_layer_class_init (ShumateMapLayerClass *klass)
 static void
 shumate_map_layer_init (ShumateMapLayer *self)
 {
-  g_object_set (G_OBJECT (self),
-                "overflow", GTK_OVERFLOW_HIDDEN,
-                NULL);
   self->tiles_positions = g_ptr_array_new_with_free_func ((GDestroyNotify) tile_grid_position_free);
   self->tile_fill = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, g_object_unref);
 }
diff --git a/shumate/shumate-view.c b/shumate/shumate-view.c
index c3a3145..7b8c6bd 100644
--- a/shumate/shumate-view.c
+++ b/shumate/shumate-view.c
@@ -733,6 +733,8 @@ shumate_view_init (ShumateView *view)
   motion_controller = gtk_event_controller_motion_new ();
   g_signal_connect_swapped (motion_controller, "motion", G_CALLBACK (on_motion_controller_motion), view);
   gtk_widget_add_controller (GTK_WIDGET (view), motion_controller);
+
+  gtk_widget_set_overflow (GTK_WIDGET (view), GTK_OVERFLOW_HIDDEN);
 }
 
 /**


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