From: SourceForge.net <no...@so...> - 2007-07-12 15:46:33
|
Bugs item #220935, was opened at 2000-11-01 02:33 Message generated for change (Comment added) made by wangnick You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=220935&group_id=12997 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 05. Canvas Items Group: obsolete: 8.4a1 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Brent B. Welch (welch) Assigned to: Jan Nijtmans (nijtmans) Summary: canvas dash update problem Initial Comment: OriginalBugID: 5997 Bug Version: 8.4a1 SubmitDate: '2000-07-10' LastModified: Severity: MED Status: UnAssn Submitter: techsupp OS: Linux-Red Hat OSVersion: see below. Machine: Linux gitarre 2.2.15 #1 Wed May 10 22:58:59 CEST 2000 i686 unkno Name: Matthias Jung Extensions: none CustomShell: no. Comments: If other dash pattern styles are specified, e.g. {40 1}, the line IS updated. E.g. the above error can be worked around by specifying .c itemconfigure 1 -dash {40 1} .c itemconfigure 1 -dash {40 40} ReproducibleScript: canvas .c pack .c .c create line 1 1 300 200 -dash {15 15} .c itemconfigure 1 -dash {40 40} ObservedBehavior: Line is not updated to the new dash pattern. DesiredBehavior: Updated dash pattern. ---------------------------------------------------------------------- Comment By: Sebastian Wangnick (wangnick) Date: 2007-07-12 17:46 Message: Logged In: YES user_id=202812 Originator: NO Note that there is another bug hidden in the canvas dash handling routines: * if ((dash->number<-1) || ((dash->number == -1) && (dash->pattern.array[1]!=','))) { char *q; int i = -dash->number; p = (i > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; q = (char *) ckalloc(2*(unsigned int)i); i = DashConvert(q, p, i, width); XSetDashes(((TkCanvas *)canvas)->display, outline->gc, outline->offset, q, i); ckfree(q); } else ... In the line * above, it should be dash->pattern.array[0]!=',' To provoke the error, create a line item with dash, say, ",,", and then reconfigure the dash to ".", and note that this will erroneously not change the pattern (since the second char in the pattern array is still ","). ---------------------------------------------------------------------- Comment By: Sebastian Wangnick (wangnick) Date: 2007-07-12 17:42 Message: Logged In: YES user_id=202812 Originator: NO This is because ANY dash setting of the form {n n} is disregarded, and rather dash 4 is implemented. See tkCanvUtil.c: * if (dash->number >= 2) { * gcValues->dashes = 4; * } else if (dash->number > 0) { gcValues->dashes = dash->pattern.array[0]; } else { gcValues->dashes = (char) (4 * width); } and then: } else if ( dash->number>2 || (dash->number==2 && (dash->pattern.array[0]!=dash->pattern.array[1]))) { p = (char *) (dash->number > sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; XSetDashes(((TkCanvas *)canvas)->display, outline->gc, outline->offset, p, dash->number); } To fix this problem the lines marked * above must be deleted. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112997&aid=220935&group_id=12997 |