[evince/wip/gpoo/gtk4-rebase-port: 41/65] ev-view: push the clip region when snapshot the widget
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/gpoo/gtk4-rebase-port: 41/65] ev-view: push the clip region when snapshot the widget
- Date: Mon, 21 Mar 2022 02:57:03 +0000 (UTC)
commit 44c06b2b93ff6a09df996cdcc93d00e84451eb18
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date: Wed Aug 18 17:25:31 2021 +0800
ev-view: push the clip region when snapshot the widget
Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>
libview/ev-view.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 661def023..a55c3f539 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -4897,9 +4897,7 @@ static void ev_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot)
height = gtk_widget_get_height(widget);
gtk_snapshot_render_background (snapshot, gtk_widget_get_style_context (widget),
- 0, 0,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ 0, 0, width, height);
clip_rect.x = 0;
clip_rect.y = 0;
@@ -4909,6 +4907,8 @@ static void ev_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot)
if (view->document == NULL)
return;
+ gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_INIT (0, 0, width, height));
+
compute_border (view, &border);
for (i = view->start_page; i >= 0 && i <= view->end_page; i++) {
GdkRectangle page_area;
@@ -4940,6 +4940,8 @@ static void ev_view_snapshot(GtkWidget *widget, GtkSnapshot *snapshot)
#endif
}
+ gtk_snapshot_pop (snapshot);
+
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]