Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/93b68a9a4869cac3ec492...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/93b68a9a4869cac3ec4927b...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/93b68a9a4869cac3ec4927b35...
The branch, master has been updated
via 93b68a9a4869cac3ec4927b35f29cac32e106832 (commit)
via c5aca9d8cecd256d957c551229be2b6856875e25 (commit)
via fb8c227ff018e21a0abd9a15852a060f4b84ba1b (commit)
from 81c40ab7c29e6bc59f4c10fa1655fd7e4a47a1ec (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=93b68a9a4869cac3ec4...
commit 93b68a9a4869cac3ec4927b35f29cac32e106832
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RISC OS: Corewindow: Fix autoscroll segfault when pointer leaves window.
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c
index 9216712..88bb5c3 100644
--- a/frontends/riscos/corewindow.c
+++ b/frontends/riscos/corewindow.c
@@ -52,6 +52,8 @@
#define wimp_KEY_END wimp_KEY_COPY
#endif
+static struct ro_corewindow *ro_cw_drag_cw;
+
/**
* Update a windows scrollbars.
*
@@ -255,6 +257,11 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data)
(unsigned int)pointer->w);
return;
}
+ if (ro_cw != ro_cw_drag_cw) {
+ NSLOG(netsurf, DEEPDEBUG, "Called without drag window: %p",
+ ro_cw);
+ return;
+ }
NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw);
/* Not a Menu click. */
@@ -391,6 +398,7 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw,
ro_warn_user("WimpError", error->errmess);
}
+ ro_cw_drag_cw = ro_cw;
ro_mouse_drag_start(ro_cw_drag_end, ro_cw_mouse_at, NULL, NULL);
}
}
@@ -1046,6 +1054,8 @@ ro_corewindow_init(struct ro_corewindow *ro_cw,
}
/* setup context for event handlers */
+ NSLOG(netsurf, INFO, "Setting corewindow %p for window handle %p",
+ ro_cw, ro_cw->wh);
ro_gui_wimp_event_set_user_data(ro_cw->wh, ro_cw);
/* register wimp events. */
diff --git a/frontends/riscos/global_history.c b/frontends/riscos/global_history.c
index 4f0dbd4..51f5390 100644
--- a/frontends/riscos/global_history.c
+++ b/frontends/riscos/global_history.c
@@ -444,6 +444,9 @@ static nserror ro_global_history_init(void)
return res;
}
+ NSLOG(netsurf, INFO, "Created global history corewindow: %p",
+ &ncwin->core);
+
res = global_history_init(ncwin->core.cb_table,
(struct core_window *)ncwin);
if (res != NSERROR_OK) {
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=c5aca9d8cecd256d957...
commit c5aca9d8cecd256d957c551229be2b6856875e25
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RISC OS: Fix EX0 EY0 rendering glitches when scrolling.
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c
index 2ef05da..9216712 100644
--- a/frontends/riscos/corewindow.c
+++ b/frontends/riscos/corewindow.c
@@ -120,10 +120,15 @@ static void ro_cw_redraw(wimp_draw *redraw)
origin_x = redraw->box.x0 - redraw->xscroll;
origin_y = redraw->box.y1 + ro_cw->origin_y - redraw->yscroll;
- r.x0 = (redraw->clip.x0 - origin_x) / 2;
- r.y0 = (origin_y - redraw->clip.y1) / 2;
- r.x1 = r.x0 + ((redraw->clip.x1 - redraw->clip.x0) / 2);
- r.y1 = r.y0 + ((redraw->clip.y1 - redraw->clip.y0) / 2);
+ ro_plot_clip_rect.x0 = redraw->clip.x0 - origin_x;
+ ro_plot_clip_rect.y0 = origin_y - redraw->clip.y0;
+ ro_plot_clip_rect.x1 = redraw->clip.x1 - origin_x;
+ ro_plot_clip_rect.y1 = origin_y - redraw->clip.y1;
+
+ r.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ r.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ r.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ r.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
/* call the draw callback */
ro_cw->draw(ro_cw, origin_x, origin_y, &r);
diff --git a/frontends/riscos/gui.h b/frontends/riscos/gui.h
index 831c57d..5ff17e9 100644
--- a/frontends/riscos/gui.h
+++ b/frontends/riscos/gui.h
@@ -165,6 +165,7 @@ void ro_gui_print_prepare(struct gui_window *g);
extern const struct plotter_table ro_plotters;
extern int ro_plot_origin_x;
extern int ro_plot_origin_y;
+extern struct rect ro_plot_clip_rect;
/* in theme_install.c */
bool ro_gui_theme_install_apply(wimp_w w);
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 25c953f..e38e746 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -39,6 +39,7 @@
int ro_plot_origin_x = 0;
int ro_plot_origin_y = 0;
+struct rect ro_plot_clip_rect;
/** One version of the A9home OS is incapable of drawing patterned lines */
bool ro_plot_patterned_lines = true;
@@ -115,6 +116,14 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect
*clip)
int clip_x1 = clip->x1 * 2;
int clip_y1 = clip->y0 * 2;
+ /* Avoid artefacts due to clip rectangle offsetting in EX0 EY0 modes.
+ * The area the WIMP asked us to draw might have dimensions that are
+ * not a multiple of 2. */
+ if (clip_x0 < ro_plot_clip_rect.x0) clip_x0 = ro_plot_clip_rect.x0;
+ if (clip_x1 > ro_plot_clip_rect.x1) clip_x1 = ro_plot_clip_rect.x1;
+ if (clip_y0 > ro_plot_clip_rect.y0) clip_y0 = ro_plot_clip_rect.y0;
+ if (clip_y1 < ro_plot_clip_rect.y1) clip_y1 = ro_plot_clip_rect.y1;
+
clip_x0 = ro_plot_origin_x + clip_x0;
clip_y0 = ro_plot_origin_y - clip_y0;
clip_x1 = ro_plot_origin_x + clip_x1 - 1;
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index f1728af..2466236 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -1685,13 +1685,19 @@ static void ro_gui_window_redraw(wimp_draw *redraw)
ro_plot_origin_x = redraw->box.x0 - redraw->xscroll;
ro_plot_origin_y = redraw->box.y1 - redraw->yscroll;
+ /* Adjust clip rect for origin. */
+ ro_plot_clip_rect.x0 = redraw->clip.x0 - ro_plot_origin_x;
+ ro_plot_clip_rect.y0 = ro_plot_origin_y - redraw->clip.y0;
+ ro_plot_clip_rect.x1 = redraw->clip.x1 - ro_plot_origin_x;
+ ro_plot_clip_rect.y1 = ro_plot_origin_y - redraw->clip.y1;
+
/* Convert OS redraw rectangle request coordinates into NetSurf
* coordinates. NetSurf coordinates have origin at top left of
* document and units are in px. */
- clip.x0 = (redraw->clip.x0 - ro_plot_origin_x) / 2; /* left */
- clip.y0 = (ro_plot_origin_y - redraw->clip.y1) / 2; /* top */
- clip.x1 = (redraw->clip.x1 - ro_plot_origin_x) / 2; /* right */
- clip.y1 = (ro_plot_origin_y - redraw->clip.y0) / 2; /* bottom */
+ clip.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ clip.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ clip.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ clip.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
if (ro_gui_current_redraw_gui->option.buffer_everything)
ro_gui_buffer_open(redraw);
@@ -4715,10 +4721,19 @@ void ro_gui_window_update_boxes(void)
ro_plot_origin_y = update.box.y1 - update.yscroll;
while (more) {
- clip.x0 = (update.clip.x0 - ro_plot_origin_x) / 2;
- clip.y0 = (ro_plot_origin_y - update.clip.y1) / 2;
- clip.x1 = (update.clip.x1 - ro_plot_origin_x) / 2;
- clip.y1 = (ro_plot_origin_y - update.clip.y0) / 2;
+ /* Adjust clip rect for origin. */
+ ro_plot_clip_rect.x0 = update.clip.x0 - ro_plot_origin_x;
+ ro_plot_clip_rect.y0 = ro_plot_origin_y - update.clip.y0;
+ ro_plot_clip_rect.x1 = update.clip.x1 - ro_plot_origin_x;
+ ro_plot_clip_rect.y1 = ro_plot_origin_y - update.clip.y1;
+
+ /* Convert OS redraw rectangle request coordinates into
+ * NetSurf coordinates. NetSurf coordinates have origin
+ * at top left of document and units are in px. */
+ clip.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ clip.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ clip.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ clip.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
if (use_buffer)
ro_gui_buffer_open(&update);
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=fb8c227ff018e21a0ab...
commit fb8c227ff018e21a0abd9a15852a060f4b84ba1b
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
RISC OS: Plotters: On RISC OS y1 is top and y0 is bottom.
When storing RISC OS coordinates, use y0 and y1 consistently.
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 2b30682..25c953f 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -110,12 +110,17 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect
*clip)
os_error *error;
char buf[12];
- int clip_x0 = ro_plot_origin_x + clip->x0 * 2;
- int clip_y0 = ro_plot_origin_y - clip->y0 * 2 - 1;
- int clip_x1 = ro_plot_origin_x + clip->x1 * 2 - 1;
- int clip_y1 = ro_plot_origin_y - clip->y1 * 2;
+ int clip_x0 = clip->x0 * 2;
+ int clip_y0 = clip->y1 * 2;
+ int clip_x1 = clip->x1 * 2;
+ int clip_y1 = clip->y0 * 2;
- if (clip_x1 < clip_x0 || clip_y0 < clip_y1) {
+ clip_x0 = ro_plot_origin_x + clip_x0;
+ clip_y0 = ro_plot_origin_y - clip_y0;
+ clip_x1 = ro_plot_origin_x + clip_x1 - 1;
+ clip_y1 = ro_plot_origin_y - clip_y1 - 1;
+
+ if (clip_x1 < clip_x0 || clip_y1 < clip_y0) {
NSLOG(netsurf, INFO, "bad clip rectangle %i %i %i %i",
clip_x0, clip_y0, clip_x1, clip_y1);
return NSERROR_BAD_SIZE;
@@ -124,12 +129,12 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect
*clip)
buf[0] = os_VDU_SET_GRAPHICS_WINDOW;
buf[1] = clip_x0;
buf[2] = clip_x0 >> 8;
- buf[3] = clip_y1;
- buf[4] = clip_y1 >> 8;
+ buf[3] = clip_y0;
+ buf[4] = clip_y0 >> 8;
buf[5] = clip_x1;
buf[6] = clip_x1 >> 8;
- buf[7] = clip_y0;
- buf[8] = clip_y0 >> 8;
+ buf[7] = clip_y1;
+ buf[8] = clip_y1 >> 8;
error = xos_writen(buf, 9);
if (error) {
@@ -365,7 +370,7 @@ ro_plot_rectangle(const struct redraw_context *ctx,
error = xos_plot(os_MOVE_TO,
ro_plot_origin_x + rect->x0 * 2,
- ro_plot_origin_y - rect->y0 * 2 - 1);
+ ro_plot_origin_y - rect->y1 * 2);
if (error) {
NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s",
error->errnum, error->errmess);
@@ -374,7 +379,7 @@ ro_plot_rectangle(const struct redraw_context *ctx,
error = xos_plot(os_PLOT_RECTANGLE | os_PLOT_TO,
ro_plot_origin_x + rect->x1 * 2 - 1,
- ro_plot_origin_y - rect->y1 * 2);
+ ro_plot_origin_y - rect->y0 * 2 - 1);
if (error) {
NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s",
error->errnum, error->errmess);
-----------------------------------------------------------------------
Summary of changes:
frontends/riscos/corewindow.c | 23 ++++++++++++++++++----
frontends/riscos/global_history.c | 3 +++
frontends/riscos/gui.h | 1 +
frontends/riscos/plotters.c | 38 +++++++++++++++++++++++++------------
frontends/riscos/window.c | 31 ++++++++++++++++++++++--------
5 files changed, 72 insertions(+), 24 deletions(-)
diff --git a/frontends/riscos/corewindow.c b/frontends/riscos/corewindow.c
index 2ef05da..88bb5c3 100644
--- a/frontends/riscos/corewindow.c
+++ b/frontends/riscos/corewindow.c
@@ -52,6 +52,8 @@
#define wimp_KEY_END wimp_KEY_COPY
#endif
+static struct ro_corewindow *ro_cw_drag_cw;
+
/**
* Update a windows scrollbars.
*
@@ -120,10 +122,15 @@ static void ro_cw_redraw(wimp_draw *redraw)
origin_x = redraw->box.x0 - redraw->xscroll;
origin_y = redraw->box.y1 + ro_cw->origin_y - redraw->yscroll;
- r.x0 = (redraw->clip.x0 - origin_x) / 2;
- r.y0 = (origin_y - redraw->clip.y1) / 2;
- r.x1 = r.x0 + ((redraw->clip.x1 - redraw->clip.x0) / 2);
- r.y1 = r.y0 + ((redraw->clip.y1 - redraw->clip.y0) / 2);
+ ro_plot_clip_rect.x0 = redraw->clip.x0 - origin_x;
+ ro_plot_clip_rect.y0 = origin_y - redraw->clip.y0;
+ ro_plot_clip_rect.x1 = redraw->clip.x1 - origin_x;
+ ro_plot_clip_rect.y1 = origin_y - redraw->clip.y1;
+
+ r.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ r.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ r.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ r.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
/* call the draw callback */
ro_cw->draw(ro_cw, origin_x, origin_y, &r);
@@ -250,6 +257,11 @@ static void ro_cw_mouse_at(wimp_pointer *pointer, void *data)
(unsigned int)pointer->w);
return;
}
+ if (ro_cw != ro_cw_drag_cw) {
+ NSLOG(netsurf, DEEPDEBUG, "Called without drag window: %p",
+ ro_cw);
+ return;
+ }
NSLOG(netsurf, INFO, "RO corewindow context %p", ro_cw);
/* Not a Menu click. */
@@ -386,6 +398,7 @@ ro_cw_drag_start(struct ro_corewindow *ro_cw,
ro_warn_user("WimpError", error->errmess);
}
+ ro_cw_drag_cw = ro_cw;
ro_mouse_drag_start(ro_cw_drag_end, ro_cw_mouse_at, NULL, NULL);
}
}
@@ -1041,6 +1054,8 @@ ro_corewindow_init(struct ro_corewindow *ro_cw,
}
/* setup context for event handlers */
+ NSLOG(netsurf, INFO, "Setting corewindow %p for window handle %p",
+ ro_cw, ro_cw->wh);
ro_gui_wimp_event_set_user_data(ro_cw->wh, ro_cw);
/* register wimp events. */
diff --git a/frontends/riscos/global_history.c b/frontends/riscos/global_history.c
index 4f0dbd4..51f5390 100644
--- a/frontends/riscos/global_history.c
+++ b/frontends/riscos/global_history.c
@@ -444,6 +444,9 @@ static nserror ro_global_history_init(void)
return res;
}
+ NSLOG(netsurf, INFO, "Created global history corewindow: %p",
+ &ncwin->core);
+
res = global_history_init(ncwin->core.cb_table,
(struct core_window *)ncwin);
if (res != NSERROR_OK) {
diff --git a/frontends/riscos/gui.h b/frontends/riscos/gui.h
index 831c57d..5ff17e9 100644
--- a/frontends/riscos/gui.h
+++ b/frontends/riscos/gui.h
@@ -165,6 +165,7 @@ void ro_gui_print_prepare(struct gui_window *g);
extern const struct plotter_table ro_plotters;
extern int ro_plot_origin_x;
extern int ro_plot_origin_y;
+extern struct rect ro_plot_clip_rect;
/* in theme_install.c */
bool ro_gui_theme_install_apply(wimp_w w);
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c
index 2b30682..e38e746 100644
--- a/frontends/riscos/plotters.c
+++ b/frontends/riscos/plotters.c
@@ -39,6 +39,7 @@
int ro_plot_origin_x = 0;
int ro_plot_origin_y = 0;
+struct rect ro_plot_clip_rect;
/** One version of the A9home OS is incapable of drawing patterned lines */
bool ro_plot_patterned_lines = true;
@@ -110,12 +111,25 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect
*clip)
os_error *error;
char buf[12];
- int clip_x0 = ro_plot_origin_x + clip->x0 * 2;
- int clip_y0 = ro_plot_origin_y - clip->y0 * 2 - 1;
- int clip_x1 = ro_plot_origin_x + clip->x1 * 2 - 1;
- int clip_y1 = ro_plot_origin_y - clip->y1 * 2;
-
- if (clip_x1 < clip_x0 || clip_y0 < clip_y1) {
+ int clip_x0 = clip->x0 * 2;
+ int clip_y0 = clip->y1 * 2;
+ int clip_x1 = clip->x1 * 2;
+ int clip_y1 = clip->y0 * 2;
+
+ /* Avoid artefacts due to clip rectangle offsetting in EX0 EY0 modes.
+ * The area the WIMP asked us to draw might have dimensions that are
+ * not a multiple of 2. */
+ if (clip_x0 < ro_plot_clip_rect.x0) clip_x0 = ro_plot_clip_rect.x0;
+ if (clip_x1 > ro_plot_clip_rect.x1) clip_x1 = ro_plot_clip_rect.x1;
+ if (clip_y0 > ro_plot_clip_rect.y0) clip_y0 = ro_plot_clip_rect.y0;
+ if (clip_y1 < ro_plot_clip_rect.y1) clip_y1 = ro_plot_clip_rect.y1;
+
+ clip_x0 = ro_plot_origin_x + clip_x0;
+ clip_y0 = ro_plot_origin_y - clip_y0;
+ clip_x1 = ro_plot_origin_x + clip_x1 - 1;
+ clip_y1 = ro_plot_origin_y - clip_y1 - 1;
+
+ if (clip_x1 < clip_x0 || clip_y1 < clip_y0) {
NSLOG(netsurf, INFO, "bad clip rectangle %i %i %i %i",
clip_x0, clip_y0, clip_x1, clip_y1);
return NSERROR_BAD_SIZE;
@@ -124,12 +138,12 @@ ro_plot_clip(const struct redraw_context *ctx, const struct rect
*clip)
buf[0] = os_VDU_SET_GRAPHICS_WINDOW;
buf[1] = clip_x0;
buf[2] = clip_x0 >> 8;
- buf[3] = clip_y1;
- buf[4] = clip_y1 >> 8;
+ buf[3] = clip_y0;
+ buf[4] = clip_y0 >> 8;
buf[5] = clip_x1;
buf[6] = clip_x1 >> 8;
- buf[7] = clip_y0;
- buf[8] = clip_y0 >> 8;
+ buf[7] = clip_y1;
+ buf[8] = clip_y1 >> 8;
error = xos_writen(buf, 9);
if (error) {
@@ -365,7 +379,7 @@ ro_plot_rectangle(const struct redraw_context *ctx,
error = xos_plot(os_MOVE_TO,
ro_plot_origin_x + rect->x0 * 2,
- ro_plot_origin_y - rect->y0 * 2 - 1);
+ ro_plot_origin_y - rect->y1 * 2);
if (error) {
NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s",
error->errnum, error->errmess);
@@ -374,7 +388,7 @@ ro_plot_rectangle(const struct redraw_context *ctx,
error = xos_plot(os_PLOT_RECTANGLE | os_PLOT_TO,
ro_plot_origin_x + rect->x1 * 2 - 1,
- ro_plot_origin_y - rect->y1 * 2);
+ ro_plot_origin_y - rect->y0 * 2 - 1);
if (error) {
NSLOG(netsurf, INFO, "xos_plot: 0x%x: %s",
error->errnum, error->errmess);
diff --git a/frontends/riscos/window.c b/frontends/riscos/window.c
index f1728af..2466236 100644
--- a/frontends/riscos/window.c
+++ b/frontends/riscos/window.c
@@ -1685,13 +1685,19 @@ static void ro_gui_window_redraw(wimp_draw *redraw)
ro_plot_origin_x = redraw->box.x0 - redraw->xscroll;
ro_plot_origin_y = redraw->box.y1 - redraw->yscroll;
+ /* Adjust clip rect for origin. */
+ ro_plot_clip_rect.x0 = redraw->clip.x0 - ro_plot_origin_x;
+ ro_plot_clip_rect.y0 = ro_plot_origin_y - redraw->clip.y0;
+ ro_plot_clip_rect.x1 = redraw->clip.x1 - ro_plot_origin_x;
+ ro_plot_clip_rect.y1 = ro_plot_origin_y - redraw->clip.y1;
+
/* Convert OS redraw rectangle request coordinates into NetSurf
* coordinates. NetSurf coordinates have origin at top left of
* document and units are in px. */
- clip.x0 = (redraw->clip.x0 - ro_plot_origin_x) / 2; /* left */
- clip.y0 = (ro_plot_origin_y - redraw->clip.y1) / 2; /* top */
- clip.x1 = (redraw->clip.x1 - ro_plot_origin_x) / 2; /* right */
- clip.y1 = (ro_plot_origin_y - redraw->clip.y0) / 2; /* bottom */
+ clip.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ clip.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ clip.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ clip.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
if (ro_gui_current_redraw_gui->option.buffer_everything)
ro_gui_buffer_open(redraw);
@@ -4715,10 +4721,19 @@ void ro_gui_window_update_boxes(void)
ro_plot_origin_y = update.box.y1 - update.yscroll;
while (more) {
- clip.x0 = (update.clip.x0 - ro_plot_origin_x) / 2;
- clip.y0 = (ro_plot_origin_y - update.clip.y1) / 2;
- clip.x1 = (update.clip.x1 - ro_plot_origin_x) / 2;
- clip.y1 = (ro_plot_origin_y - update.clip.y0) / 2;
+ /* Adjust clip rect for origin. */
+ ro_plot_clip_rect.x0 = update.clip.x0 - ro_plot_origin_x;
+ ro_plot_clip_rect.y0 = ro_plot_origin_y - update.clip.y0;
+ ro_plot_clip_rect.x1 = update.clip.x1 - ro_plot_origin_x;
+ ro_plot_clip_rect.y1 = ro_plot_origin_y - update.clip.y1;
+
+ /* Convert OS redraw rectangle request coordinates into
+ * NetSurf coordinates. NetSurf coordinates have origin
+ * at top left of document and units are in px. */
+ clip.x0 = (ro_plot_clip_rect.x0 ) / 2; /* left */
+ clip.y0 = (ro_plot_clip_rect.y1 ) / 2; /* top */
+ clip.x1 = (ro_plot_clip_rect.x1 + 1) / 2; /* right */
+ clip.y1 = (ro_plot_clip_rect.y0 + 1) / 2; /* bottom */
if (use_buffer)
ro_gui_buffer_open(&update);
--
NetSurf Browser