Subject: -lmargincolor tag configuration option: implementation slightly optimized since Tk_Fill3DRectangle is robust with respect to negative widths

From: fvogel <[email-masked]>
Date: Thu, 11 Feb 2016 13:17:51 +0000

---
 generic/tkTextDisp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index c0dc017..f871fc1 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -2479,10 +2479,9 @@ DisplayDLine(
      * Second, draw the background color of the left and right margins.
      */
     if (dlPtr->lMarginColor != NULL) {
-        int x = dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset;
-
         Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->lMarginColor, 0, y,
-                (x>0?x:0), dlPtr->height, 0, TK_RELIEF_FLAT);
+                dlPtr->lMarginWidth + dInfoPtr->x - dInfoPtr->curXPixelOffset,
+                dlPtr->height, 0, TK_RELIEF_FLAT);
     }
     if (dlPtr->rMarginColor != NULL) {
         Tk_Fill3DRectangle(textPtr->tkwin, pixmap, dlPtr->rMarginColor,
-- 
cgit v0.12