summaryrefslogtreecommitdiffstats
path: root/bingram.c
diff options
context:
space:
mode:
Diffstat (limited to 'bingram.c')
-rw-r--r--bingram.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/bingram.c b/bingram.c
index 5e65d7a..c7d1a70 100644
--- a/bingram.c
+++ b/bingram.c
@@ -403,20 +403,30 @@ vis(void)
}
if (show_pos) {
+ snprintf(fmtbuf, sizeof(fmtbuf),
+ "%08lx > %08lx", data_window_start,
+ data_window_start + data_window_len);
+ len = MeasureText(fmtbuf, 20) + 20;
+ ImageDrawRectangle(&window_image,
+ window_width - len - 9, 0,
+ len + 9, 19, WHITE);
+ ImageDrawText(&window_image,
+ fmtbuf, window_width - len - 6,
+ 0, 20, BLACK);
+
data_x = (ssize_t) zoom_x + (mouse_x / zoom);
data_y = (ssize_t) zoom_y + (mouse_y / zoom);
if (data_x >= 0 && data_x < data_width
&& data_y >= 0 && data_y < data_height) {
- pos = data_window_start + data_y * data_width + data_x;
snprintf(fmtbuf, sizeof(fmtbuf),
"%02lx > %02lx", data_x, data_y);
- len = MeasureText(fmtbuf, 20) + 10;
+ len = MeasureText(fmtbuf, 20);
ImageDrawRectangle(&window_image,
- window_width - len - 9, 0,
- len + 9, 19, WHITE);
+ window_width - len - 4, 19,
+ len + 4, 19, WHITE);
ImageDrawText(&window_image,
- fmtbuf, window_width - len - 6,
- 0, 20, BLACK);
+ fmtbuf, window_width - len - 1,
+ 20, 19, BLACK);
}
}