summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvUtil.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-06-23 05:16:59 (GMT)
committernijtmans <nijtmans>2009-06-23 05:16:59 (GMT)
commit40c2d29deac65574947296aa7400d688228c30ad (patch)
treed8c1544fba5d37694bbc8cb28107e7dea58debe6 /generic/tkCanvUtil.c
parentb26869b0edef57b82e649adfae9759d43c7c7f65 (diff)
downloadtk-40c2d29deac65574947296aa7400d688228c30ad.zip
tk-40c2d29deac65574947296aa7400d688228c30ad.tar.gz
tk-40c2d29deac65574947296aa7400d688228c30ad.tar.bz2
fix [Bug #220935] canvas dash update problemmacosx_carbon_freeze
(follow-up)
Diffstat (limited to 'generic/tkCanvUtil.c')
-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);