BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
07654075
Commit
07654075
authored
Feb 24, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent refresh after drag is no movement happened
parent
f3e1df39
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
lv_indev.c
lv_core/lv_indev.c
+8
-2
lv_refr.c
lv_core/lv_refr.c
+19
-0
lv_refr.h
lv_core/lv_refr.h
+11
-0
No files found.
lv_core/lv_indev.c
View file @
07654075
...
...
@@ -11,6 +11,7 @@
#include "../lv_hal/lv_hal_tick.h"
#include "../lv_core/lv_group.h"
#include "../lv_core/lv_refr.h"
#include "../lv_misc/lv_task.h"
#include "../lv_misc/lv_math.h"
#include "../lv_draw/lv_draw_rbasic.h"
...
...
@@ -646,9 +647,10 @@ static void indev_drag(lv_indev_proc_t * state)
/*Set new position if the vector is not zero*/
if
(
state
->
vect
.
x
!=
0
||
state
->
vect
.
y
!=
0
)
{
/*Get the coordinates of the object
e
nd modify them*/
/*Get the coordinates of the object
a
nd modify them*/
lv_coord_t
act_x
=
lv_obj_get_x
(
drag_obj
);
lv_coord_t
act_y
=
lv_obj_get_y
(
drag_obj
);
uint16_t
inv_buf_size
=
lv_refr_get_buf_size
();
/*Get the number of currently invalidated areas*/
lv_obj_set_pos
(
drag_obj
,
act_x
+
state
->
vect
.
x
,
act_y
+
state
->
vect
.
y
);
...
...
@@ -660,7 +662,11 @@ static void indev_drag(lv_indev_proc_t * state)
}
state
->
drag_in_prog
=
1
;
}
/*If the object didn't moved then clear the invalidated areas*/
else
{
uint16_t
new_inv_buf_size
=
lv_refr_get_buf_size
();
lv_refr_pop_from_buf
(
new_inv_buf_size
-
inv_buf_size
);
}
}
}
}
...
...
lv_core/lv_refr.c
View file @
07654075
...
...
@@ -139,6 +139,25 @@ void lv_refr_set_round_cd(void(*cb)(lv_area_t*))
round_cb
=
cb
;
}
/**
* Get the number of areas in the buffer
* @return number of invalid areas
*/
uint16_t
lv_refr_get_buf_size
(
void
)
{
return
inv_buf_p
;
}
/**
* Pop (delete) the last 'num' invalidated areas from the buffer
* @param num number of areas to delete
*/
void
lv_refr_pop_from_buf
(
uint16_t
num
)
{
if
(
inv_buf_p
<
num
)
inv_buf_p
=
0
;
else
inv_buf_p
-=
num
;
}
/**********************
* STATIC FUNCTIONS
**********************/
...
...
lv_core/lv_refr.h
View file @
07654075
...
...
@@ -65,6 +65,17 @@ void lv_refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t));
*/
void
lv_refr_set_round_cd
(
void
(
*
cb
)(
lv_area_t
*
));
/**
* Get the number of areas in the buffer
* @return number of invalid areas
*/
uint16_t
lv_refr_get_buf_size
(
void
);
/**
* Pop (delete) the last 'num' invalidated areas from the buffer
* @param num number of areas to delete
*/
void
lv_refr_pop_from_buf
(
uint16_t
num
);
/**********************
* STATIC FUNCTIONS
**********************/
...
...
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