summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-06-23 05:21:37 (GMT)
committernijtmans <nijtmans>2009-06-23 05:21:37 (GMT)
commit07c9eccedfff3b0d9f6c47c8cba58d0e9eb7d0a3 (patch)
tree8dbe78047e9f24fa87f299e83b158ddbf0018b1f /generic
parentcaa91573d1ffb67d97604b735dced193464c0bc3 (diff)
downloadtk-07c9eccedfff3b0d9f6c47c8cba58d0e9eb7d0a3.zip
tk-07c9eccedfff3b0d9f6c47c8cba58d0e9eb7d0a3.tar.gz
tk-07c9eccedfff3b0d9f6c47c8cba58d0e9eb7d0a3.tar.bz2
fix [Bug #220935] canvas dash update problem
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvUtil.c18
1 files changed, 7 insertions, 11 deletions
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);