[sysprof/wip/chergert/sysprof-3] libsysprof-ui: reduce chances of over-scrolling
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/wip/chergert/sysprof-3] libsysprof-ui: reduce chances of over-scrolling
- Date: Wed, 15 May 2019 21:44:09 +0000 (UTC)
commit c9e6004dc2d4b0b61ddb1747c4b9e2bfe2b04283
Author: Christian Hergert <chergert redhat com>
Date: Wed May 15 14:44:01 2019 -0700
libsysprof-ui: reduce chances of over-scrolling
src/libsysprof-ui/sysprof-capture-view.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-capture-view.c b/src/libsysprof-ui/sysprof-capture-view.c
index 1fedccd..5f9d25a 100644
--- a/src/libsysprof-ui/sysprof-capture-view.c
+++ b/src/libsysprof-ui/sysprof-capture-view.c
@@ -725,11 +725,15 @@ sysprof_capture_view_fit_to_width (SysprofCaptureView *self)
GtkAllocation alloc;
gdouble zoom;
gint64 duration;
+ gint width;
g_return_if_fail (SYSPROF_IS_CAPTURE_VIEW (self));
- duration = priv->features.end_time - priv->features.begin_time;
+ /* Trim a bit off the width to avoid drawing past edges */
gtk_widget_get_allocation (GTK_WIDGET (self), &alloc);
- zoom = sysprof_zoom_manager_fit_zoom_for_duration (priv->zoom_manager, duration, alloc.width);
+ width = MAX (100, alloc.width - 25);
+
+ duration = priv->features.end_time - priv->features.begin_time;
+ zoom = sysprof_zoom_manager_fit_zoom_for_duration (priv->zoom_manager, duration, width);
sysprof_zoom_manager_set_zoom (priv->zoom_manager, zoom);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]