Skip to content

Commit

Permalink
protect -insertborderwidth/-insertwidth/-selborderwidth, which cannot…
Browse files Browse the repository at this point in the history
… be negative
  • Loading branch information
jan.nijtmans committed Sep 29, 2024
1 parent 575910a commit b5775ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions generic/tkCanvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -2357,6 +2357,15 @@ ConfigureCanvas(
canvasPtr->yScrollIncrement = 0;
}
canvasPtr->inset = canvasPtr->borderWidth + canvasPtr->highlightWidth;
if (canvasPtr->textInfo.insertBorderWidth < 0) {
canvasPtr->textInfo.insertBorderWidth = 0;
}
if (canvasPtr->textInfo.insertWidth < 0) {
canvasPtr->textInfo.insertWidth = 0;
}
if (canvasPtr->textInfo.selBorderWidth < 0) {
canvasPtr->textInfo.selBorderWidth = 0;
}

gcValues.function = GXcopy;
gcValues.graphics_exposures = False;
Expand Down

0 comments on commit b5775ed

Please sign in to comment.