From 07c9eccedfff3b0d9f6c47c8cba58d0e9eb7d0a3 Mon Sep 17 00:00:00 2001 From: nijtmans Date: Tue, 23 Jun 2009 05:21:37 +0000 Subject: fix [Bug #220935] canvas dash update problem --- ChangeLog | 4 ++++ generic/tkCanvUtil.c | 18 +++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70534c1..e77fd48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-23 Jan Nijtmans + + * generic/tkCanvUtil.c fix [Bug #220935] canvas dash update problem + 2009-06-02 Pat Thoyts * win/tkWinWm.c: [Bug 2799589] Backported fix for crash on diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 9bd60d4..c0d6bea 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvUtil.c,v 1.19.2.1 2008/12/21 23:52:45 ferrieux Exp $ + * RCS: @(#) $Id: tkCanvUtil.c,v 1.19.2.2 2009/06/23 05:21:38 nijtmans Exp $ */ #include "tkInt.h" @@ -1136,12 +1136,10 @@ Tk_ConfigOutlineGC( if (mask && (dash->number != 0)) { gcValues->line_style = LineOnOffDash; gcValues->dash_offset = outline->offset; - if (dash->number >= 2) { - gcValues->dashes = 4; - } else if (dash->number > 0) { + if (dash->number > 0) { gcValues->dashes = dash->pattern.array[0]; } else { - gcValues->dashes = (char) (4 * width); + gcValues->dashes = (char) (4 * width + 0.5); } mask |= GCLineStyle|GCDashList|GCDashOffset; } @@ -1221,7 +1219,7 @@ Tk_ChangeOutlineGC( } if ((dash->number<-1) || - ((dash->number == -1) && (dash->pattern.array[1] != ','))) { + ((dash->number == -1) && (dash->pattern.array[0] != ','))) { char *q; int i = -dash->number; @@ -1341,13 +1339,11 @@ Tk_ResetOutlineGC( if ((dash->number > 2) || (dash->number < -1) || (dash->number==2 && (dash->pattern.array[0] != dash->pattern.array[1])) || - ((dash->number == -1) && (dash->pattern.array[1] != ','))) { - if (dash->number < 0) { - dashList = (int) (4 * width + 0.5); - } else if (dash->number<3) { + ((dash->number == -1) && (dash->pattern.array[0] != ','))) { + if (dash->number > 0) { dashList = dash->pattern.array[0]; } else { - dashList = 4; + dashList = (char) (4 * width + 0.5); } XSetDashes(((TkCanvas *)canvas)->display, outline->gc, outline->offset, &dashList , 1); -- cgit v0.12