1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[node] get_element -> get_element_rect

This commit is contained in:
Witold Filipczyk 2024-01-27 13:53:24 +01:00
parent 06ffcc8085
commit 84660b694d
2 changed files with 7 additions and 8 deletions

View File

@ -291,8 +291,6 @@ render_xhtml_document(struct cache_entry *cached, struct document *document, str
dump_xhtml(cached, document, 0); dump_xhtml(cached, document, 0);
} }
static struct node_rect *get_element(struct document *doc, int offset);
static void static void
walk_tree2(struct document *document, dom_node *node) walk_tree2(struct document *document, dom_node *node)
{ {
@ -329,7 +327,7 @@ walk_tree2(struct document *document, dom_node *node)
if (offset <= 0) { if (offset <= 0) {
return; return;
} }
struct node_rect *tab = get_element(document, offset); struct node_rect *tab = get_element_rect(document, offset);
if (!tab) { if (!tab) {
return; return;
@ -349,7 +347,7 @@ walk_tree2(struct document *document, dom_node *node)
if (offset_i <= 0) { if (offset_i <= 0) {
goto next; goto next;
} }
struct node_rect *rect_i = get_element(document, offset_i); struct node_rect *rect_i = get_element_rect(document, offset_i);
if (!rect_i) { if (!rect_i) {
goto next; goto next;
@ -401,7 +399,7 @@ walk_tree2_color(struct terminal *term, struct el_box *box, struct document *doc
if (offset <= 0) { if (offset <= 0) {
return; return;
} }
struct node_rect *tab = get_element(document, offset); struct node_rect *tab = get_element_rect(document, offset);
if (!tab) { if (!tab) {
return; return;
@ -570,8 +568,8 @@ walk2(struct document *document)
static int prev_offset = 0; static int prev_offset = 0;
static struct node_rect *prev_element = NULL; static struct node_rect *prev_element = NULL;
static struct node_rect * struct node_rect *
get_element(struct document *document, int offset) get_element_rect(struct document *document, int offset)
{ {
if (offset == prev_offset) { if (offset == prev_offset) {
return prev_element; return prev_element;
@ -638,7 +636,7 @@ scan_document(struct document_view *doc_view)
if (!offset) { if (!offset) {
continue; continue;
} }
struct node_rect *tab = get_element(doc_view->document, offset); struct node_rect *tab = get_element_rect(doc_view->document, offset);
if (!tab) { if (!tab) {
continue; continue;

View File

@ -21,6 +21,7 @@ void dump_xhtml(struct cache_entry *cached, struct document *document, int parse
void walk2(struct document *document); void walk2(struct document *document);
void scan_document(struct document_view *doc_view); void scan_document(struct document_view *doc_view);
void try_to_color(struct terminal *term, struct el_box *box, struct document *document, int vx, int vy); void try_to_color(struct terminal *term, struct el_box *box, struct document *document, int vx, int vy);
struct node_rect *get_element_rect(struct document *document, int offset);
#ifdef __cplusplus #ifdef __cplusplus
} }