cairo_t *cr = cursor->cr;
double new_x, new_y;
+ if (strlen (word) < 3)
+ return;
+
cairo_move_to (cr, cursor->x, cursor->y);
if (*entry & RACK_DICT_ENTRY_FOUND) {
cairo_show_text (cr, word);
}
}
+#define SOLUTION_FONT_SIZE 12
+#define SOLUTION_LINE_HEIGHT (1.5 * SOLUTION_FONT_SIZE)
+
static void
dict_paint (cairo_t *cr, void *closure, double width, double height)
{
cursor.cr = cr;
- cairo_set_font_size (cr, 12);
- cursor.line_height = 14;
+ cairo_select_font_face (cr, "mono", 0, 0);
+ cairo_set_font_size (cr, SOLUTION_FONT_SIZE);
+ cursor.line_height = SOLUTION_LINE_HEIGHT;
cursor.x = 0;
cursor.y = 0;
if (event->keyval == GDK_Return) {
dict_entry_t *entry;
- entry = dict_lookup (rack->solution, rack->guess);
- if (DICT_ENTRY_IS_WORD (entry)) {
- *entry = *entry | RACK_DICT_ENTRY_FOUND;
- goo_canvas_item_simple_changed (GOO_CANVAS_ITEM_SIMPLE (rack->solution_item), FALSE);
+ if (rack->guess_length >= 3) {
+ entry = dict_lookup (rack->solution, rack->guess);
+ if (DICT_ENTRY_IS_WORD (entry)) {
+ *entry = *entry | RACK_DICT_ENTRY_FOUND;
+ goo_canvas_item_simple_changed (GOO_CANVAS_ITEM_SIMPLE (rack->solution_item), FALSE);
+ }
}
rack_return_all (rack);
return TRUE;
root = goo_canvas_get_root_item (GOO_CANVAS (canvas));
rack->solution_item = goo_demo_item_new (root,
- LETTER_PAD,
+ LETTER_PAD + SOLUTION_LINE_HEIGHT,
LETTER_PAD + 2 * (LETTER_SIZE + 2 * LETTER_PAD),
400, 400 - (2 * (LETTER_SIZE + 2 * LETTER_PAD)),
dict_paint, rack->solution,