Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
55a4b2ce
Commit
55a4b2ce
authored
May 19, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scroll view/time.c if control+mouse wheel
parent
392a818b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
common/utils/T/tracer/view/time.c
common/utils/T/tracer/view/time.c
+20
-0
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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