diff --git a/src/callbacks.c b/src/callbacks.c index 239b590..3fcf17f 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -403,13 +403,13 @@ gboolean on_motion (GtkWidget *win, if (devdata->cur_context->arrowsize > 0) { GromitArrowType atype = devdata->cur_context->arrow_type; - gint width = devdata->cur_context->arrowsize * devdata->cur_context->width / 2; + gfloat width = devdata->cur_context->arrowsize * devdata->cur_context->width; gfloat direction = atan2(ev->y - devdata->lasty, ev->x - devdata->lastx); if (atype & GROMIT_ARROW_END) - draw_arrow(data, ev->device, ev->x, ev->y, width * 2, direction); + draw_arrow(data, ev->device, ev->x, ev->y, width, direction); if (atype & GROMIT_ARROW_START) - draw_arrow(data, ev->device, devdata->lastx, devdata->lasty, width * 2, M_PI + direction); + draw_arrow(data, ev->device, devdata->lastx, devdata->lasty, width, M_PI + direction); } } else if (type == GROMIT_RECT) diff --git a/src/config.c b/src/config.c index c441de2..d3aaa49 100644 --- a/src/config.c +++ b/src/config.c @@ -163,7 +163,8 @@ gboolean parse_config (GromitData *data) GromitPaintType type; GdkRGBA *fg_color=NULL; - guint width, arrowsize, minwidth, maxwidth; + guint width, minwidth, maxwidth; + gfloat arrowsize; guint minlen, maxangle, radius, simplify, snapdist; GromitArrowType arrowtype; @@ -373,9 +374,9 @@ gboolean parse_config (GromitData *data) } else if ((intptr_t) scanner->value.v_symbol == SYM_ARROWSIZE) { - gfloat v = parse_get_float(scanner, "Missing arrowsize (float)"); - if (isnan(v)) goto cleanup; - arrowsize = (guint)(v + 0.5); + arrowsize = parse_get_float(scanner, "Missing arrowsize (float)"); + if (isnan(arrowsize)) goto cleanup; + if (arrowsize < 1) arrowsize = 1; arrowtype = GROMIT_ARROW_END; } else if ((intptr_t) scanner->value.v_symbol == SYM_ARROWTYPE) diff --git a/src/drawing.c b/src/drawing.c index 1307322..cdca212 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -41,7 +41,7 @@ void draw_line (GromitData *data, void draw_arrow (GromitData *data, GdkDevice *dev, gint x1, gint y1, - gint width, + gfloat width, gfloat direction) { GdkRectangle rect; diff --git a/src/drawing.h b/src/drawing.h index 2abf151..ebdcabc 100644 --- a/src/drawing.h +++ b/src/drawing.h @@ -17,6 +17,6 @@ typedef struct void draw_line (GromitData *data, GdkDevice *dev, gint x1, gint y1, gint x2, gint y2); -void draw_arrow (GromitData *data, GdkDevice *dev, gint x1, gint y1, gint width, gfloat direction); +void draw_arrow (GromitData *data, GdkDevice *dev, gint x1, gint y1, gfloat width, gfloat direction); #endif diff --git a/src/main.c b/src/main.c index de8c696..cd2d050 100644 --- a/src/main.c +++ b/src/main.c @@ -41,7 +41,7 @@ GromitPaintContext *paint_context_new (GromitData *data, GromitPaintType type, GdkRGBA *paint_color, guint width, - guint arrowsize, + gfloat arrowsize, GromitArrowType arrowtype, guint simpilfy, guint radius, diff --git a/src/main.h b/src/main.h index 77ae382..9c5b108 100644 --- a/src/main.h +++ b/src/main.h @@ -194,7 +194,7 @@ void clear_screen (GromitData *data); GromitPaintContext *paint_context_new (GromitData *data, GromitPaintType type, GdkRGBA *fg_color, guint width, - guint arrowsize, GromitArrowType arrowtype, + gfloat arrowsize, GromitArrowType arrowtype, guint simpilfy, guint radius, guint maxangle, guint minlen, guint snapdist, guint minwidth, guint maxwidth); void paint_context_free (GromitPaintContext *context);