mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: reuse selection for in/out params
This commit is contained in:
@ -171,20 +171,18 @@ get_selected_area (SysprofTracksView *self,
|
|||||||
if (self->session == NULL)
|
if (self->session == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
*area = GRAPHENE_RECT_INIT (gtk_widget_get_width (self->top_left),
|
||||||
|
0,
|
||||||
|
gtk_widget_get_width (GTK_WIDGET (self)) - gtk_widget_get_width (self->top_left),
|
||||||
|
gtk_widget_get_height (GTK_WIDGET (self)));
|
||||||
|
|
||||||
if (self->in_drag_selection && self->drag_offset_x != .0)
|
if (self->in_drag_selection && self->drag_offset_x != .0)
|
||||||
{
|
{
|
||||||
graphene_rect_t sel;
|
*selection = GRAPHENE_RECT_INIT (self->drag_offset_x >= 0 ? self->drag_start_x : self->drag_start_x + self->drag_offset_x,
|
||||||
|
0,
|
||||||
*area = GRAPHENE_RECT_INIT (gtk_widget_get_width (self->top_left),
|
ABS (self->drag_offset_x),
|
||||||
0,
|
gtk_widget_get_height (GTK_WIDGET (self)));
|
||||||
gtk_widget_get_width (GTK_WIDGET (self)) - gtk_widget_get_width (self->top_left),
|
return graphene_rect_intersection (area, selection, selection);
|
||||||
gtk_widget_get_height (GTK_WIDGET (self)));
|
|
||||||
sel = GRAPHENE_RECT_INIT (self->drag_offset_x >= 0 ? self->drag_start_x : self->drag_start_x + self->drag_offset_x,
|
|
||||||
0,
|
|
||||||
ABS (self->drag_offset_x),
|
|
||||||
gtk_widget_get_height (GTK_WIDGET (self)));
|
|
||||||
|
|
||||||
return graphene_rect_intersection (area, &sel, selection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If selected range == visible range, then there is no selection */
|
/* If selected range == visible range, then there is no selection */
|
||||||
|
|||||||
Reference in New Issue
Block a user