mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Merge branch 'line_layer_fix' into 'master'
sysprof/chart: Translate origin of child chart layer Closes #126 See merge request GNOME/sysprof!123
This commit is contained in:
@ -135,6 +135,7 @@ sysprof_chart_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
SysprofChart *self = (SysprofChart *)widget;
|
SysprofChart *self = (SysprofChart *)widget;
|
||||||
SysprofChartPrivate *priv = sysprof_chart_get_instance_private (self);
|
SysprofChartPrivate *priv = sysprof_chart_get_instance_private (self);
|
||||||
|
graphene_point_t child_origin;
|
||||||
|
|
||||||
g_assert (SYSPROF_IS_CHART (self));
|
g_assert (SYSPROF_IS_CHART (self));
|
||||||
|
|
||||||
@ -144,11 +145,20 @@ sysprof_chart_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkWidget *pick = gtk_widget_pick (widget, priv->motion_x, priv->motion_y, GTK_PICK_DEFAULT);
|
GtkWidget *pick = gtk_widget_pick (widget, priv->motion_x, priv->motion_y, GTK_PICK_DEFAULT);
|
||||||
|
|
||||||
if (SYSPROF_IS_CHART_LAYER (pick))
|
if (SYSPROF_IS_CHART_LAYER (pick) &&
|
||||||
sysprof_chart_layer_snapshot_motion (SYSPROF_CHART_LAYER (pick),
|
gtk_widget_compute_point (pick, widget, &GRAPHENE_POINT_INIT (0, 0), &child_origin))
|
||||||
snapshot,
|
{
|
||||||
priv->motion_x,
|
gtk_snapshot_translate (snapshot, &child_origin);
|
||||||
priv->motion_y);
|
|
||||||
|
sysprof_chart_layer_snapshot_motion (SYSPROF_CHART_LAYER (pick),
|
||||||
|
snapshot,
|
||||||
|
priv->motion_x,
|
||||||
|
priv->motion_y);
|
||||||
|
|
||||||
|
child_origin.x *= -1;
|
||||||
|
child_origin.y *= -1;
|
||||||
|
gtk_snapshot_translate (snapshot, &child_origin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user