summaryrefslogtreecommitdiff
path: root/code/fe310/eos/eve_text.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-02-26 02:43:49 +0100
committerUros Majstorovic <majstor@majstor.org>2020-02-26 02:43:49 +0100
commit3afd7bb15a74e1c2a458ecd16c547ba4dfc7eb1e (patch)
tree51ce7d67624b429774457f93e23ffb9ee041b66d /code/fe310/eos/eve_text.c
parent26e0687ecc5e3a68c0a89e3d31d238224dc214b5 (diff)
eve etype refactor; eve text track with inert bugfix
Diffstat (limited to 'code/fe310/eos/eve_text.c')
-rw-r--r--code/fe310/eos/eve_text.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/code/fe310/eos/eve_text.c b/code/fe310/eos/eve_text.c
index 0f93b20..9470530 100644
--- a/code/fe310/eos/eve_text.c
+++ b/code/fe310/eos/eve_text.c
@@ -42,7 +42,7 @@ void eve_text_init(EVEText *box, uint16_t x, uint16_t y, uint16_t w, uint16_t h,
box->dl_size += 1;
}
- eve_touch_set_opt(tag, EVE_TOUCH_ETYPE_TRACK);
+ eve_touch_set_opt(tag, EVE_TOUCH_OPT_TRACK);
eve_cmd(CMD_MEMSET, "www", mem_addr, 0x0, box->w * 2 * box->line_size);
eve_cmd_exec(1);
@@ -56,14 +56,9 @@ int eve_text_touch(EVEText *box, uint8_t tag0, int touch_idx) {
EVETouch *t = eve_touch_evt(tag0, touch_idx, box->tag, box->tag, &evt);
if (t && evt) {
- if (evt & EVE_TOUCH_ETYPE_TAG) {
- if (box->line_top < 0) {
- box->line_top = box->line0;
- box->line_top0 = box->line0;
- }
- }
- if (evt & EVE_TOUCH_ETYPE_TAG_UP) {
- box->line_top0 = box->line_top;
+ if ((evt & EVE_TOUCH_ETYPE_TRACK_START) && (box->line_top < 0)) {
+ box->line_top = box->line0;
+ box->line_top0 = box->line0;
}
if ((evt & EVE_TOUCH_ETYPE_TRACK) && (box->line_top0 >=0)) {
int line = LINE_IDX_ADD(box->line_top0, (t->y0 - t->y) / box->ch_h, box->line_size);
@@ -72,6 +67,9 @@ int eve_text_touch(EVEText *box, uint8_t tag0, int touch_idx) {
box->dirty = 1;
}
}
+ if (evt & EVE_TOUCH_ETYPE_TRACK_STOP) {
+ box->line_top0 = box->line_top;
+ }
return 1;
} else if (box->line_top >= 0) {
box->line_top = -1;