From: SourceForge.net <no...@so...> - 2007-07-13 17:01:12
|
Bugs item #220935, was opened at 2000-10-31 17:33 Message generated for change (Comment added) made by hobbs 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: development: 8.4.16 Status: Open Resolution: None Priority: 6 Private: No Submitted By: Brent B. Welch (welch) Assigned to: Jeffrey Hobbs (hobbs) 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: Jeffrey Hobbs (hobbs) Date: 2007-07-13 10:01 Message: Logged In: YES user_id=72656 Originator: NO Could you please provide a clear patch (diff -u format) for those items for testing? ---------------------------------------------------------------------- Comment By: Sebastian Wangnick (wangnick) Date: 2007-07-12 23:24 Message: Logged In: YES user_id=202812 Originator: NO Note that the two patches described earlier must also be reflected in Tk_ResetOutlineGC. ---------------------------------------------------------------------- Comment By: Sebastian Wangnick (wangnick) Date: 2007-07-12 08: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 08: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 |