aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-09 06:55:00 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-09 06:57:02 +0100
commited39a9b434f90a62d80b984eb98e89ac833b5b4b (patch)
tree9c054882678b157c58a87018d84d3b175883bca1 /fastiv-view.c
parenta135d6f332c31b11b8d4c4b3c3cfb0b500beffb7 (diff)
downloadfiv-ed39a9b434f90a62d80b984eb98e89ac833b5b4b.tar.gz
fiv-ed39a9b434f90a62d80b984eb98e89ac833b5b4b.tar.xz
fiv-ed39a9b434f90a62d80b984eb98e89ac833b5b4b.zip
Add elementary scrolling support to the view
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index 037008d..da4aa12 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -60,21 +60,15 @@ static void
fastiv_view_get_preferred_height(
GtkWidget *widget, gint *minimum, gint *natural)
{
- *minimum = 0;
- *natural = 0;
-
FastivView *self = FASTIV_VIEW(widget);
- *natural = get_display_height(self);
+ *minimum = *natural = get_display_height(self);
}
static void
fastiv_view_get_preferred_width(GtkWidget *widget, gint *minimum, gint *natural)
{
- *minimum = 0;
- *natural = 0;
-
FastivView *self = FASTIV_VIEW(widget);
- *natural = get_display_width(self);
+ *minimum = *natural = get_display_width(self);
}
static void
@@ -207,6 +201,7 @@ fastiv_view_open(FastivView *self, const gchar *path, GError **error)
cairo_surface_destroy(self->surface);
self->surface = surface;
+ self->scale = 1.0;
gtk_widget_queue_resize(GTK_WIDGET(self));
return TRUE;
}