summaryrefslogtreecommitdiff
path: root/atari
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-02-14 22:05:39 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-02-14 22:05:39 +0000
commit94e7b44ebc1710eed0f870428ddb5bfcd85858fa (patch)
tree2d75845c082051bac12cd41cf2d5139e019c16bf /atari
parent3ce0613193ca945566ec9ea056d6a67eae7d199c (diff)
downloadnetsurf-94e7b44ebc1710eed0f870428ddb5bfcd85858fa.tar.gz
netsurf-94e7b44ebc1710eed0f870428ddb5bfcd85858fa.tar.bz2
Pass clip rect to clip plotters as struct. Simplify clip rect handling in debug window code. Pass clip rect to select menu as struct.
svn path=/trunk/netsurf/; revision=11683
Diffstat (limited to 'atari')
-rwxr-xr-xatari/browser.c20
-rwxr-xr-xatari/plot.c4
-rwxr-xr-xatari/plot.h4
3 files changed, 18 insertions, 10 deletions
diff --git a/atari/browser.c b/atari/browser.c
index 2c667a5d7..8d2f79ca5 100755
--- a/atari/browser.c
+++ b/atari/browser.c
@@ -873,9 +873,7 @@ static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff )
clip.x1 = b->redraw.area.x1 + b->scroll.current.x;
clip.y1 = b->redraw.area.y1 + b->scroll.current.y;
/* must clear the surface: */
- plot.clip( b->redraw.area.x0, b->redraw.area.y0,
- b->redraw.area.x1, b->redraw.area.y1
- );
+ plot.clip(&clip);
plot.rectangle( b->redraw.area.x0,
b->redraw.area.y0,
b->redraw.area.x1,
@@ -911,16 +909,24 @@ void browser_redraw_caret( struct gui_window * gw, GRECT * area )
caret.g_x -= gw->browser->scroll.current.x;
caret.g_y -= gw->browser->scroll.current.y;
struct s_clipping oldclip;
+ struct rect old_clip;
+ struct rect clip;
+ clip.x0 = caret.g_x - 1;
+ clip.y0 = caret.g_y - 1;
+ clip.x1 = caret.g_x + caret.g_w + 1;
+ clip.y1 = caret.g_y + caret.g_h + 1;
plot_get_clip( &oldclip );
/* clip to cursor: */
- plot_clip( caret.g_x-1, caret.g_y -1,
- caret.g_x + caret.g_w + 1, caret.g_y + caret.g_h + 1
- );
+ plot_clip( &clip );
plot_rectangle( caret.g_x, caret.g_y,
caret.g_x+caret.g_w, caret.g_y+caret.g_h,
plot_style_caret );
/* restore clip area: */
- plot_clip( oldclip.x0, oldclip.y0, oldclip.x1,oldclip.y1);
+ old_clip.x0 = old_clip.x0;
+ old_clip.y0 = old_clip.y0;
+ old_clip.x1 = old_clip.x1;
+ old_clip.y1 = old_clip.y1;
+ plot_clip( &old_clip );
b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
b->caret.current.g_w = caret.g_w;
diff --git a/atari/plot.c b/atari/plot.c
index 2bfe37923..2d45f1f63 100755
--- a/atari/plot.c
+++ b/atari/plot.c
@@ -110,9 +110,9 @@ static bool plot_polygon(const int *p, unsigned int n,
return ( true );
}
-bool plot_clip(int x0, int y0, int x1, int y1)
+bool plot_clip(const struct rect *clip)
{
- plotter->clip( plotter, x0, y0, x1, y1 );
+ plotter->clip( plotter, clip->x0, clip->y0, clip->x1, clip->y1 );
return ( true );
}
diff --git a/atari/plot.h b/atari/plot.h
index ed86041e5..a11b6d576 100755
--- a/atari/plot.h
+++ b/atari/plot.h
@@ -22,11 +22,13 @@
#include "desktop/plotters.h"
#include "atari/plot/plotter.h"
+struct rect;
+
int atari_plotter_init( char*, char * );
int atari_plotter_finalise( void );
bool plot_get_clip(struct s_clipping * out);
-bool plot_clip(int x0, int y0, int x1, int y1);
+bool plot_clip(const struct rect *clip);
bool plot_rectangle( int x0, int y0, int x1, int y1,const plot_style_t *style );
#endif