diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 08:01:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 08:01:35 (GMT) |
commit | 7ee90e287a0a8d613e7b76474f9500bb2ac1eed8 (patch) | |
tree | 9b38a6c2d32327a6d86d5907724ce5084be60e34 /generic | |
parent | dafd0980f12d3583ecd80f68fe51edcee80c8d6f (diff) | |
download | tk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.zip tk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.tar.gz tk-7ee90e287a0a8d613e7b76474f9500bb2ac1eed8.tar.bz2 |
Fix for [237971ce]: [$canvas insert] changed behaviour. Also added testcase from Emiliano Gavilan.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvLine.c | 2 | ||||
-rw-r--r-- | generic/tkCanvPoly.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index e7e8904..07dbb70 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -1748,7 +1748,7 @@ GetLineIndex( const char *string; (void)canvas; - if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 0, &idx)) { + if (TCL_OK == TkGetIntForIndex(obj, 2*linePtr->numPoints - 1, 1, &idx)) { if (idx == TCL_INDEX_NONE) { idx = 0; } else if (idx > (2*(TkSizeT)linePtr->numPoints)) { diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 1620914..90b2896 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -1683,6 +1683,8 @@ GetPolygonIndex( if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX - 1) - ((INT_MAX) % count), 1, &idx)) { if (idx == TCL_INDEX_NONE) { idx = 0; + } else if (idx >= INT_MAX - ((INT_MAX) % count)) { + idx = count; } else { idx = (idx & (TkSizeT)-2) % count; } |