mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-ui: reduce chances of over-scrolling
This commit is contained in:
@ -725,11 +725,15 @@ sysprof_capture_view_fit_to_width (SysprofCaptureView *self)
|
|||||||
GtkAllocation alloc;
|
GtkAllocation alloc;
|
||||||
gdouble zoom;
|
gdouble zoom;
|
||||||
gint64 duration;
|
gint64 duration;
|
||||||
|
gint width;
|
||||||
|
|
||||||
g_return_if_fail (SYSPROF_IS_CAPTURE_VIEW (self));
|
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);
|
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);
|
sysprof_zoom_manager_set_zoom (priv->zoom_manager, zoom);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user