summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans@noemail.net>2009-06-23 05:16:58 (GMT)
committernijtmans <nijtmans@noemail.net>2009-06-23 05:16:58 (GMT)
commit10ad4e02363efe830916ec866abaab10b3c60aec (patch)
treed8c1544fba5d37694bbc8cb28107e7dea58debe6
parentfe09ac68f07e90aeb01f959083d18e0a32b3238d (diff)
downloadtk-10ad4e02363efe830916ec866abaab10b3c60aec.zip
tk-10ad4e02363efe830916ec866abaab10b3c60aec.tar.gz
tk-10ad4e02363efe830916ec866abaab10b3c60aec.tar.bz2
fix [Bug #220935] canvas dash update problemmacosx-carbon-freeze
(follow-up) FossilOrigin-Name: b5433c4426ba84f7c6fc752bb029bbc1569a161a
-rw-r--r--generic/tkCanvUtil.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c
index ccc2494..0856927 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.25 2009/06/22 05:52:38 nijtmans Exp $
+ * RCS: @(#) $Id: tkCanvUtil.c,v 1.26 2009/06/23 05:16:59 nijtmans Exp $
*/
#include "tkInt.h"
@@ -1122,12 +1122,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;
}
@@ -1258,7 +1256,7 @@ Tk_ChangeOutlineGC(
*
* Tk_ResetOutlineGC
*
- * Restores the GC to the situation before Tk_ChangeDashGC() was called.
+ * Restores the GC to the situation before Tk_ChangeOutlineGC() was called.
* This function should be called just after the dashed item is drawn,
* because the GC is supposed to be read-only.
*
@@ -1328,12 +1326,10 @@ 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[0] != ','))) {
- if (dash->number < 0) {
- dashList = (int) (4 * width + 0.5);
- } else if (dash->number<3) {
+ if (dash->number > 0) {
dashList = dash->pattern.array[0];
} else {
- dashList = 4;
+ dashList = (char) (4 * width + 0.5);
}
XSetDashes(Canvas(canvas)->display, outline->gc, outline->offset,
&dashList , 1);