summaryrefslogtreecommitdiff
path: root/tk/win/tkWinDraw.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-09-24 20:37:56 +0000
committerKeith Seitz <keiths@redhat.com>2002-09-24 20:37:56 +0000
commitc709ff98b014a66934671dcece6d2b26d5101b1a (patch)
tree2cae57d3bed8d1c06b191a3d847ed0bfd0f48676 /tk/win/tkWinDraw.c
parent07296cfdb73a6d68eb6b921fd25c7c9dacdf1eec (diff)
downloadgdb-c709ff98b014a66934671dcece6d2b26d5101b1a.tar.gz
import tk 8.4.0TK_8_4_0
Diffstat (limited to 'tk/win/tkWinDraw.c')
-rw-r--r--tk/win/tkWinDraw.c20
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);
}
-
-