Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
55a4b2ce
Commit
55a4b2ce
authored
May 19, 2016
by
Cédric Roux
Browse files
scroll view/time.c if control+mouse wheel
parent
392a818b
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/utils/T/tracer/view/time.c
View file @
55a4b2ce
...
...
@@ -159,15 +159,34 @@ static void scroll(void *private, gui *g,
struct
time
*
this
=
private
;
int
*
d
=
notification_data
;
int
x
=
d
[
0
];
int
key_modifiers
=
d
[
2
];
double
mul
=
1
.
2
;
double
pixel_length
;
int64_t
old_px_len_rounded
;
struct
timespec
t
;
int
scroll_px
;
int
width
;
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
old_px_len_rounded
=
this
->
pixel_length
;
/* scroll if control+wheel, zoom otherwise */
if
(
key_modifiers
&
KEY_CONTROL
)
{
timeline_get_width
(
this
->
g
,
this
->
w
,
&
width
);
if
(
width
<
2
)
width
=
2
;
scroll_px
=
100
;
if
(
scroll_px
>
width
-
1
)
scroll_px
=
width
-
1
;
if
(
!
strcmp
(
notification
,
"scrolldown"
))
this
->
start_time
=
time_add
(
this
->
start_time
,
nano_to_time
(
scroll_px
*
old_px_len_rounded
));
else
this
->
start_time
=
time_sub
(
this
->
start_time
,
nano_to_time
(
scroll_px
*
old_px_len_rounded
));
goto
end
;
}
if
(
!
strcmp
(
notification
,
"scrollup"
))
mul
=
1
/
mul
;
again:
...
...
@@ -191,6 +210,7 @@ again:
t
=
time_add
(
this
->
start_time
,
nano_to_time
(
x
*
old_px_len_rounded
));
this
->
start_time
=
time_sub
(
t
,
nano_to_time
(
x
*
(
int64_t
)
pixel_length
));
end:
if
(
pthread_mutex_unlock
(
&
this
->
lock
))
abort
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment