4 * The geeky little puzzle game with a big noodly crunch!
6 * gPlanarity copyright (C) 2005 Monty <monty@xiph.org>
7 * Original Flash game by John Tantalo <john.tantalo@case.edu>
8 * Original game concept by Mary Radcliffe
10 * gPlanarity is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option)
15 * gPlanarity is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Postfish; see the file COPYING. If not, write to the
22 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtk/gtkmain.h>
37 #include "gameboard.h"
41 void draw_selection_rectangle(Gameboard
*g
,cairo_t
*c
){
42 cairo_set_source_rgba(c
,SELECTBOX_COLOR
);
43 cairo_rectangle(c
,g
->selectionx
,
50 // invalidate the selection box plus enough area to catch any verticies
51 void invalidate_selection(GtkWidget
*widget
){
52 Gameboard
*g
= GAMEBOARD (widget
);
54 r
.x
= g
->selectionx
- (V_RADIUS
+ V_LINE
)*2;
55 r
.y
= g
->selectiony
- (V_RADIUS
+ V_LINE
)*2;
56 r
.width
= g
->selectionw
+ (V_RADIUS
+ V_LINE
)*4;
57 r
.height
= g
->selectionh
+ (V_RADIUS
+ V_LINE
)*4;
59 gdk_window_invalidate_rect (widget
->window
, &r
, FALSE
);
62 // invalidate the selection box plus enough area to catch any verticies
63 void invalidate_verticies_selection(GtkWidget
*widget
){
64 Gameboard
*g
= GAMEBOARD (widget
);
65 vertex
*v
=g
->g
.verticies
;
68 invalidate_vertex_off(widget
,v
,g
->dragx
,g
->dragy
);
69 invalidate_edges(widget
,v
,g
->dragx
,g
->dragy
);