diff options
Diffstat (limited to 'tk/win/tkWinDraw.c')
-rw-r--r-- | tk/win/tkWinDraw.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tk/win/tkWinDraw.c b/tk/win/tkWinDraw.c index eafe1effd78..a4dc49db73c 100644 --- a/tk/win/tkWinDraw.c +++ b/tk/win/tkWinDraw.c @@ -589,6 +589,12 @@ TkPutImage(colors, ncolors, display, d, gc, image, src_x, src_y, dest_x, image->data, infoPtr, DIB_RGB_COLORS); ckfree((char *) infoPtr); } + if(!bitmap) { + panic("Fail to allocate bitmap\n"); + DeleteDC(dcMem); + TkWinReleaseDrawableDC(d, dc, &state); + return; + } bitmap = SelectObject(dcMem, bitmap); BitBlt(dc, dest_x, dest_y, width, height, dcMem, src_x, src_y, SRCCOPY); DeleteObject(SelectObject(dcMem, bitmap)); @@ -745,15 +751,13 @@ RenderObject(dc, gc, points, npoints, mode, pen, func) } /* - * Grow the bounding box enough to account for wide lines. + * Grow the bounding box enough to account for line width. */ - if (gc->line_width > 1) { - rect.left -= gc->line_width; - rect.top -= gc->line_width; - rect.right += gc->line_width; - rect.bottom += gc->line_width; - } + rect.left -= gc->line_width; + rect.top -= gc->line_width; + rect.right += gc->line_width; + rect.bottom += gc->line_width; width = rect.right - rect.left; height = rect.bottom - rect.top; @@ -1333,5 +1337,3 @@ TkpDrawHighlightBorder(tkwin, fgGC, bgGC, highlightWidth, drawable) { TkDrawInsetFocusHighlight(tkwin, fgGC, highlightWidth, drawable, 0); } - - |