mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Merge pull request #23 from sgerwk/master
when searching in a node, only search within its box
This commit is contained in:
commit
b4766aa0cd
@ -153,12 +153,13 @@ get_srch(struct document *document)
|
|||||||
|
|
||||||
foreachback (node, document->nodes) {
|
foreachback (node, document->nodes) {
|
||||||
int x, y;
|
int x, y;
|
||||||
int height = document->height;
|
int height = int_min(node->box.y + node->box.height, document->height);
|
||||||
|
|
||||||
for (y = node->box.y; y < height; y++) {
|
for (y = node->box.y; y < height; y++) {
|
||||||
int width = document->data[y].length;
|
int width = int_min(node->box.x + node->box.width,
|
||||||
|
document->data[y].length);
|
||||||
|
|
||||||
for (x = 0;
|
for (x = node->box.x;
|
||||||
x < width && document->data[y].chars[x].data <= ' ';
|
x < width && document->data[y].chars[x].data <= ' ';
|
||||||
x++);
|
x++);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user