summaryrefslogtreecommitdiff
path: root/render/html_redraw.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-07-13 13:20:26 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-07-13 13:20:26 +0000
commit9c918930289b18dbfd4bb44081891d5780105bfd (patch)
tree372de7dbf3d8393550e46ab1f8de6e9a97cf2140 /render/html_redraw.c
parent1832155b7c64e0a977541930fc78f47bbd675ab2 (diff)
downloadnetsurf-9c918930289b18dbfd4bb44081891d5780105bfd.tar.gz
netsurf-9c918930289b18dbfd4bb44081891d5780105bfd.tar.bz2
Fix selection for non-gui browser windows (iframes).
Selection no longer uses current_redraw_browser. Fix long-standing selection bugs on platforms that use action on release behaviour. svn path=/trunk/netsurf/; revision=12598
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r--render/html_redraw.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 1b762614c..41b78314a 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -52,16 +52,16 @@
#include "utils/utils.h"
-static bool html_redraw_box(html_content *html, struct box *box, int x, int y,
- const struct rect *clip, float scale,
+static bool html_redraw_box(const html_content *html, struct box *box,
+ int x, int y, const struct rect *clip, float scale,
colour current_background_color,
const struct redraw_context *ctx);
-static bool html_redraw_box_children(html_content *html, struct box *box,
+static bool html_redraw_box_children(const html_content *html, struct box *box,
int x_parent, int y_parent, const struct rect *clip,
float scale, colour current_background_color,
const struct redraw_context *ctx);
-static bool html_redraw_text_box(struct box *box, int x, int y,
- const struct rect *clip, float scale,
+static bool html_redraw_text_box(const html_content *html, struct box *box,
+ int x, int y, const struct rect *clip, float scale,
colour current_background_color,
const struct redraw_context *ctx);
static bool html_redraw_borders(struct box *box, int x_parent, int y_parent,
@@ -253,7 +253,7 @@ static struct box *html_redraw_find_bg_box(struct box *box)
* x, y, clip_[xy][01] are in target coordinates.
*/
-bool html_redraw_box(html_content *html, struct box *box,
+bool html_redraw_box(const html_content *html, struct box *box,
int x_parent, int y_parent,
const struct rect *clip, float scale,
colour current_background_color,
@@ -692,7 +692,7 @@ bool html_redraw_box(html_content *html, struct box *box,
return false;
} else if (box->text) {
- if (!html_redraw_text_box(box, x, y, &r, scale,
+ if (!html_redraw_text_box(html, box, x, y, &r, scale,
current_background_color, ctx))
return false;
@@ -770,7 +770,7 @@ bool html_redraw_box(html_content *html, struct box *box,
* \return true if successful, false otherwise
*/
-bool html_redraw_box_children(html_content *html, struct box *box,
+bool html_redraw_box_children(const html_content *html, struct box *box,
int x_parent, int y_parent,
const struct rect *clip, float scale,
colour current_background_color,
@@ -818,8 +818,8 @@ bool html_redraw_box_children(html_content *html, struct box *box,
* \return true iff successful and redraw should proceed
*/
-bool html_redraw_text_box(struct box *box, int x, int y,
- const struct rect *clip, float scale,
+bool html_redraw_text_box(const html_content *html, struct box *box,
+ int x, int y, const struct rect *clip, float scale,
colour current_background_color,
const struct redraw_context *ctx)
{
@@ -831,7 +831,7 @@ bool html_redraw_text_box(struct box *box, int x, int y,
if (!text_redraw(box->text, box->length, box->byte_offset,
box->space, &fstyle, x, y,
- clip, box->height, scale, excluded, ctx))
+ clip, box->height, scale, excluded, &html->sel, ctx))
return false;
return true;
@@ -859,7 +859,7 @@ bool html_redraw_text_box(struct box *box, int x, int y,
bool text_redraw(const char *utf8_text, size_t utf8_len,
size_t offset, int space, const plot_font_style_t *fstyle,
int x, int y, const struct rect *clip, int height,
- float scale, bool excluded,
+ float scale, bool excluded, const struct selection *sel,
const struct redraw_context *ctx)
{
const struct plotter_table *plot = ctx->plot;
@@ -876,9 +876,9 @@ bool text_redraw(const char *utf8_text, size_t utf8_len,
unsigned end_idx;
/* first try the browser window's current selection */
- if (selection_defined(current_redraw_browser->sel) &&
- selection_highlighted(current_redraw_browser->sel,
- offset, offset + len, &start_idx, &end_idx)) {
+ if (selection_defined(sel) && selection_highlighted(sel,
+ offset, offset + len,
+ &start_idx, &end_idx)) {
highlighted = true;
}