summaryrefslogtreecommitdiff
path: root/atari/redrawslots.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2012-11-30 03:20:52 +0100
committerOle Loots <ole@monochrom.net>2012-11-30 03:20:52 +0100
commitea025e60083af859001ea709065efab6600c5bab (patch)
tree2e344173c9e7dfe1581274522cbc7e14e3cf93c7 /atari/redrawslots.c
parent67d4da38ad994e3468119e3d6cc6f6041786144b (diff)
downloadnetsurf-ea025e60083af859001ea709065efab6600c5bab.tar.gz
netsurf-ea025e60083af859001ea709065efab6600c5bab.tar.bz2
Toolbar is now finished, started work on browser redraw/scrolling.
Diffstat (limited to 'atari/redrawslots.c')
-rw-r--r--atari/redrawslots.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/atari/redrawslots.c b/atari/redrawslots.c
index d2f74e4fb..fdc35554a 100644
--- a/atari/redrawslots.c
+++ b/atari/redrawslots.c
@@ -52,45 +52,48 @@ static inline bool rect_intersect( struct rect * box1, struct rect * box2 )
}
-void redraw_slot_schedule_grect(struct s_redrw_slots * slots, GRECT *area)
+void redraw_slot_schedule_grect(struct s_redrw_slots * slots, GRECT *area,
+ bool force)
{
redraw_slot_schedule(slots, area->g_x, area->g_y,
- area->g_x + area->g_w, area->g_y + area->g_h);
+ area->g_x + area->g_w, area->g_y + area->g_h, force);
}
/*
schedule redraw coords.
*/
void redraw_slot_schedule(struct s_redrw_slots * slots, short x0, short y0,
- short x1, short y1)
+ short x1, short y1, bool force)
{
- int i;
+ int i = 0;
struct rect area;
area.x0 = x0;
area.y0 = y0;
area.x1 = x1;
area.y1 = y1;
-
- for( i=0; i<slots->areas_used; i++) {
- if( slots->areas[i].x0 <= x0
- && slots->areas[i].x1 >= x1
- && slots->areas[i].y0 <= y0
- && slots->areas[i].y1 >= y1 ){
- /* the area is already queued for redraw */
- return;
- } else {
- if( rect_intersect(&slots->areas[i], &area ) ){
- slots->areas[i].x0 = MIN(slots->areas[i].x0, x0);
- slots->areas[i].y0 = MIN(slots->areas[i].y0, y0);
- slots->areas[i].x1 = MAX(slots->areas[i].x1, x1);
- slots->areas[i].y1 = MAX(slots->areas[i].y1, y1);
- return;
- }
- }
+
+ if (force == false) {
+ for (i=0; i<slots->areas_used; i++) {
+ if (slots->areas[i].x0 <= x0
+ && slots->areas[i].x1 >= x1
+ && slots->areas[i].y0 <= y0
+ && slots->areas[i].y1 >= y1) {
+ /* the area is already queued for redraw */
+ return;
+ } else {
+ if (rect_intersect(&slots->areas[i], &area )) {
+ slots->areas[i].x0 = MIN(slots->areas[i].x0, x0);
+ slots->areas[i].y0 = MIN(slots->areas[i].y0, y0);
+ slots->areas[i].x1 = MAX(slots->areas[i].x1, x1);
+ slots->areas[i].y1 = MAX(slots->areas[i].y1, y1);
+ return;
+ }
+ }
+ }
}
- if( slots->areas_used < slots->size ) {
+ if (slots->areas_used < slots->size) {
slots->areas[slots->areas_used].x0 = x0;
slots->areas[slots->areas_used].x1 = x1;
slots->areas[slots->areas_used].y0 = y0;