diff options
-rw-r--r-- | src/nautilus-file.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 6b4b2319a..02e8307b0 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -5103,6 +5103,7 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, double height = gdk_pixbuf_get_height (pixbuf) / scale; g_autoptr (GdkTexture) texture = gdk_texture_new_for_pixbuf (pixbuf); g_autoptr (GtkSnapshot) snapshot = gtk_snapshot_new (); + GskRoundedRect rounded_rect; if (MAX (width, height) > size) { @@ -5112,6 +5113,11 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, height = height / scale_down_factor; } + gsk_rounded_rect_init_from_rect (&rounded_rect, + &GRAPHENE_RECT_INIT (0, 0, width, height), + 2 /* radius*/); + gtk_snapshot_push_rounded_clip (snapshot, &rounded_rect); + gdk_paintable_snapshot (GDK_PAINTABLE (texture), GDK_SNAPSHOT (snapshot), width, height); @@ -5122,6 +5128,8 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file, nautilus_ui_frame_video (snapshot, width, height); } + gtk_snapshot_pop (snapshot); /* End rounded clip */ + DEBUG ("Returning thumbnailed image, at size %d %d", (int) (width), (int) (height)); paintable = gtk_snapshot_to_paintable (snapshot, NULL); |