summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-02-10 09:00:09 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-02-10 09:00:09 (GMT)
commite93687e98f7a46c65307e4820355ada663131577 (patch)
tree13d267d2617a5aa36823369f5271483cdc3d59d5 /generic
parent861c3b79214beb32cdd3861a1054cbbdabd80b0d (diff)
downloadtk-e93687e98f7a46c65307e4820355ada663131577.zip
tk-e93687e98f7a46c65307e4820355ada663131577.tar.gz
tk-e93687e98f7a46c65307e4820355ada663131577.tar.bz2
Better debug output formatting (from Scott).
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvas.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 331b7e3..609ed6e 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2709,7 +2709,13 @@ DrawCanvas(
for (iy = 0; iy < ximagePtr->height; ++ iy) {
Tcl_AppendResult(interp, " {", NULL);
for (ix = 0; ix < ximagePtr->bytes_per_line; ++ ix) {
- sprintf(buffer," 0x%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF);
+ if (ix > 0) {
+ if (ix % 4 == 0)
+ Tcl_AppendResult(interp, "-", NULL);
+ else
+ Tcl_AppendResult(interp, " ", NULL);
+ }
+ sprintf(buffer,"%2.2x",ximagePtr->data[ximagePtr->bytes_per_line * iy + ix]&0xFF);
Tcl_AppendResult(interp, buffer, NULL);
}
Tcl_AppendResult(interp, " }", NULL);
@@ -2775,9 +2781,6 @@ DrawCanvas(
#endif
for(x = 0; x < blockPtr.width; ++x) {
unsigned long pixel;
-#ifdef DEBUG_DRAWCANVAS
- Tcl_AppendResult(interp, " {", NULL);
-#endif
switch (ximagePtr->bits_per_pixel) {
/*
@@ -2827,8 +2830,13 @@ DrawCanvas(
#ifdef DEBUG_DRAWCANVAS
{
int ix;
- for (ix = 0; ix < 3; ++ix)
- sprintf(buffer,"0x%2.2x",blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); Tcl_AppendResult(interp, " ", buffer, NULL);
+ if (x > 0)
+ Tcl_AppendResult(interp, "-", NULL);
+ for (ix = 0; ix < 4; ++ix) {
+ if (ix > 0)
+ Tcl_AppendResult(interp, " ", NULL);
+ sprintf(buffer,"%2.2x",blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + ix]&0xFF); Tcl_AppendResult(interp, buffer, NULL);
+ }
}
#endif
}