Hiroyuki Ikezoe
ikezo****@users*****
2006年 11月 23日 (木) 11:43:36 JST
Index: libtomoe-gtk/src/tomoe-canvas.c diff -u libtomoe-gtk/src/tomoe-canvas.c:1.20 libtomoe-gtk/src/tomoe-canvas.c:1.21 --- libtomoe-gtk/src/tomoe-canvas.c:1.20 Thu Nov 23 10:12:52 2006 +++ libtomoe-gtk/src/tomoe-canvas.c Thu Nov 23 11:43:36 2006 @@ -28,6 +28,7 @@ #include "tomoe-canvas.h" #define TOMOE_CANVAS_DEFAULT_SIZE 300 +#define TOMOE_WRITING_DEFAULT_SIZE 300 #define TOMOE_CANVAS_DEFAULT_RATE 0.7 enum { @@ -462,8 +463,8 @@ for (point = new_points; point; point = g_list_next (point)) { TomoePoint *p = (TomoePoint *) point->data; gint x, y; - x = p->x * ((gdouble)TOMOE_CANVAS_DEFAULT_SIZE / priv->size); - y = p->y * ((gdouble)TOMOE_CANVAS_DEFAULT_SIZE / priv->size); + x = p->x * ((gdouble)TOMOE_WRITING_DEFAULT_SIZE / priv->size); + y = p->y * ((gdouble)TOMOE_WRITING_DEFAULT_SIZE / priv->size); tomoe_writing_line_to (g, x, y); } } @@ -978,15 +979,17 @@ TomoeCanvasPriv *priv = TOMOE_CANVAS_GET_PRIVATE (canvas); GtkWidget *widget = GTK_WIDGET (canvas); gint x, y, width, height; - - x = MIN (p1->x, p2->x) - 2; - y = MIN (p1->y, p2->y) - 2; - width = abs (p1->x - p2->x) + (2 * 2); - height = abs (p1->y - p2->y) + (2 * 2); + gdouble factor = 1.0 / ((gdouble)TOMOE_WRITING_DEFAULT_SIZE / (gdouble)priv->size); gdk_draw_line (priv->pixmap, priv->handwrite_line_gc, - p1->x, p1->y, p2->x, p2->y); + p1->x * factor, p1->y * factor, + p2->x * factor, p2->y * factor); if (draw) { + x = (MIN (p1->x, p2->x) - 2) * factor; + y = (MIN (p1->y, p2->y) - 2) * factor; + width = (abs (p1->x - p2->x) + (2 * 2)) * factor; + height = (abs (p1->y - p2->y) + (2 * 2)) * factor; + gtk_widget_queue_draw_area (widget, x, y, width, height); } } @@ -1178,7 +1181,7 @@ gdouble dl; gint sign; - gdouble factor = 1.0 / ((gdouble)TOMOE_CANVAS_DEFAULT_SIZE / (gdouble)priv->size); + gdouble factor = 1.0 / ((gdouble)TOMOE_WRITING_DEFAULT_SIZE / (gdouble)priv->size); x = ((TomoePoint*)(points->data))->x * factor; y = ((TomoePoint*)(points->data))->y * factor;