diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2008-04-07 09:00:21 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2008-04-07 09:00:21 +0000 |
commit | 8b2a23081f5fdf09e4448a79e85b07b715549eda (patch) | |
tree | 753660a92a11784869a9b66b60effd1864abebdb /render/box.c | |
parent | 8de0baae0b3400bbb9ae44325cc83c122f41ca15 (diff) | |
download | netsurf-8b2a23081f5fdf09e4448a79e85b07b715549eda.tar.gz netsurf-8b2a23081f5fdf09e4448a79e85b07b715549eda.tar.bz2 |
Various text selection improvements:
+ Fix redraw bug where parts of old selections would get left behind
+ Enable selection of list marker boxes (bullet points and numbers)
+ Improve formatting of copied-to-clipboard or saved text selections
+ Select click anywhere outside current selection now clears current selection
svn path=/trunk/netsurf/; revision=4079
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/render/box.c b/render/box.c index 9598a0cf4..9aadcda86 100644 --- a/render/box.c +++ b/render/box.c @@ -335,6 +335,17 @@ non_float_children: } } + /* marker boxes */ + if (box->list_marker) { + if (box_contains_point(box->list_marker, x - bx, y - by)) { + *box_x = bx + box->list_marker->x - + box->list_marker->scroll_x; + *box_y = by + box->list_marker->y - + box->list_marker->scroll_y; + return box->list_marker; + } + } + siblings: /* siblings and siblings of ancestors */ while (box) { @@ -405,6 +416,22 @@ bool box_contains_point(struct box *box, int x, int y) y < box->y + box->padding[TOP] + box->height + box->border[BOTTOM] + box->padding[BOTTOM]) return true; + if (box->list_marker && box->list_marker->x <= x + + box->list_marker->border[LEFT] && + x < box->list_marker->x + + box->list_marker->padding[LEFT] + + box->list_marker->width + + box->list_marker->border[RIGHT] + + box->list_marker->padding[RIGHT] && + box->list_marker->y <= y + + box->list_marker->border[TOP] && + y < box->list_marker->y + + box->list_marker->padding[TOP] + + box->list_marker->height + + box->list_marker->border[BOTTOM] + + box->list_marker->padding[BOTTOM]) { + return true; + } } else { if (box->x + box->descendant_x0 <= x && x < box->x + box->descendant_x1 && |