diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2021-04-25 21:07:15 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2021-04-25 21:07:15 +0100 |
commit | c5aca9d8cecd256d957c551229be2b6856875e25 (patch) | |
tree | cdf8c13f683bed1eee6a87892cdef1b1c0ac1175 /frontends/riscos/plotters.c | |
parent | fb8c227ff018e21a0abd9a15852a060f4b84ba1b (diff) | |
download | netsurf-c5aca9d8cecd256d957c551229be2b6856875e25.tar.gz netsurf-c5aca9d8cecd256d957c551229be2b6856875e25.tar.bz2 |
RISC OS: Fix EX0 EY0 rendering glitches when scrolling.
Diffstat (limited to 'frontends/riscos/plotters.c')
-rw-r--r-- | frontends/riscos/plotters.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontends/riscos/plotters.c b/frontends/riscos/plotters.c index 25c953f97..e38e746cd 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; |