diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-02-15 15:28:48 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-02-15 15:28:48 +0100 |
| commit | 3880f640cf44288f09b76195025de4192f7f2108 (patch) | |
| tree | 05085fe31b223826431be41a625d5a1eb0a5ff84 | |
| parent | bfc06901ee84ad52febf3fe67a89f789e16fc5b8 (diff) | |
| download | bingram-master.tar.gz bingram-master.zip | |
| -rw-r--r-- | bingram.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -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); } } |
