From f436179c0f05c6c963eccd55eebefe1d0eff95cd Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Sat, 4 Oct 2025 18:06:22 +0200 Subject: [PATCH 1/2] Consider line stroke for tick label offset --- crates/maps/src/grid.rs | 2 +- crates/maps/tests/snapshots/aligned_view.png | 2 +- crates/maps/tests/snapshots/dense_grid_precision.png | 4 ++-- crates/maps/tests/snapshots/fixed_lens.png | 4 ++-- crates/maps/tests/snapshots/fixed_lens_background.png | 4 ++-- crates/maps/tests/snapshots/google_cartographer_example.png | 4 ++-- crates/maps/tests/snapshots/measurement.png | 2 +- crates/maps/tests/snapshots/nav2_example.png | 4 ++-- crates/maps/tests/snapshots/pixel_test.png | 4 ++-- crates/maps/tests/snapshots/reload_session_config.png | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/maps/src/grid.rs b/crates/maps/src/grid.rs index 3bc7586..4c688cb 100644 --- a/crates/maps/src/grid.rs +++ b/crates/maps/src/grid.rs @@ -341,7 +341,7 @@ impl Grid { let (label_pos, label_value, line_visible) = match direction { LineDirection::Vertical => ( egui::Pos2::new( - coord, + coord + stroke.width, self.painter.clip_rect().height() + self.ui_offset.y - label_text_options.offset.y, ), diff --git a/crates/maps/tests/snapshots/aligned_view.png b/crates/maps/tests/snapshots/aligned_view.png index 60933d4..4abcf4d 100644 --- a/crates/maps/tests/snapshots/aligned_view.png +++ b/crates/maps/tests/snapshots/aligned_view.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9e00a48309c216fc25ee61bb866897269790fd16e5dc3c23fa0f70003edaa16 +oid sha256:5d744fb4b4e5feb21db188a1356c1632aeeb0dc9bf2b5062c1916bbb3e64d20d size 73008 diff --git a/crates/maps/tests/snapshots/dense_grid_precision.png b/crates/maps/tests/snapshots/dense_grid_precision.png index 40dac84..2422ff8 100644 --- a/crates/maps/tests/snapshots/dense_grid_precision.png +++ b/crates/maps/tests/snapshots/dense_grid_precision.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41af1dd04995253aae944175ffca68dad8dadb8f3057b11defb6e837d1daddf1 -size 69908 +oid sha256:ade2f7d14248538124f84cceddf8c6a4d98e80b40030bc0b09811248080223fe +size 69815 diff --git a/crates/maps/tests/snapshots/fixed_lens.png b/crates/maps/tests/snapshots/fixed_lens.png index 3326c9b..fa37b3a 100644 --- a/crates/maps/tests/snapshots/fixed_lens.png +++ b/crates/maps/tests/snapshots/fixed_lens.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8bee0d4a9eedb8f64326860ba91de76aef3e26f8414cbe85a5dbc5341515f07 -size 121493 +oid sha256:b7653312630f8b8d74e680d50e34e799d4dd074d2d330884c70621074f0f4916 +size 121346 diff --git a/crates/maps/tests/snapshots/fixed_lens_background.png b/crates/maps/tests/snapshots/fixed_lens_background.png index 7032ad4..e76471e 100644 --- a/crates/maps/tests/snapshots/fixed_lens_background.png +++ b/crates/maps/tests/snapshots/fixed_lens_background.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bdc79812cb59438f54205b6c6cdd50ae046e6b30ea4b3cd825f544c91a96f4a7 -size 85003 +oid sha256:ef044fac0508db6a30aafc0a97d43fe6327a8c61f57ab7ce09e6c09d39584556 +size 84838 diff --git a/crates/maps/tests/snapshots/google_cartographer_example.png b/crates/maps/tests/snapshots/google_cartographer_example.png index beb6415..b1f533a 100644 --- a/crates/maps/tests/snapshots/google_cartographer_example.png +++ b/crates/maps/tests/snapshots/google_cartographer_example.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b025748f74cdf74814cce4659b91630acac8f6b6ded36919cf949f610fc3ee9 -size 272425 +oid sha256:0993f18f95d77a95415f306ec49af1a2910886e83a0f3e4330bd509733d2f895 +size 272423 diff --git a/crates/maps/tests/snapshots/measurement.png b/crates/maps/tests/snapshots/measurement.png index 3ff3707..b28cd3a 100644 --- a/crates/maps/tests/snapshots/measurement.png +++ b/crates/maps/tests/snapshots/measurement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aef53c8b326466a350cfc28dfe81e9af257ea83bf6a6849e922cc6a66020c742 +oid sha256:d2be54121c47b3758d4129fe2927bc318b47c4cb27177ed59a93a93f94ba3472 size 87691 diff --git a/crates/maps/tests/snapshots/nav2_example.png b/crates/maps/tests/snapshots/nav2_example.png index b8e72d9..b17d703 100644 --- a/crates/maps/tests/snapshots/nav2_example.png +++ b/crates/maps/tests/snapshots/nav2_example.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:50be2ed8f158c28e8d6dd3e44e4557ebad00133a8be9add06745e6574d468f84 -size 72533 +oid sha256:343d31db6c9c926170d76a333f779c02761ada30519ced9f61cba8feea00c3f9 +size 72534 diff --git a/crates/maps/tests/snapshots/pixel_test.png b/crates/maps/tests/snapshots/pixel_test.png index 7269239..8c0673a 100644 --- a/crates/maps/tests/snapshots/pixel_test.png +++ b/crates/maps/tests/snapshots/pixel_test.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c284a3b9c26de2924d3d98fff773b88101895f9bf1c2f59fe7c29633aae75060 -size 36441 +oid sha256:cb5cea10f85273bc2d6a44d10e2ca8238a5446d9637af8403cf9cc438061028f +size 36435 diff --git a/crates/maps/tests/snapshots/reload_session_config.png b/crates/maps/tests/snapshots/reload_session_config.png index 4181b51..b086039 100644 --- a/crates/maps/tests/snapshots/reload_session_config.png +++ b/crates/maps/tests/snapshots/reload_session_config.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2efcef8e5472601053ed2e921a5c0ee5cafb50d37cf5bc5106c67cae1417e5b -size 261914 +oid sha256:644c54bef98efc1b4fb115b771e81a6b9158f8d8f38d27f19fe52af20b2f2b07 +size 261923 From 7075234146a168b90bc3d406eab4ae8c7d8cb1dd Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Sun, 5 Oct 2025 18:38:19 +0200 Subject: [PATCH 2/2] also y --- crates/maps/src/grid.rs | 2 +- crates/maps/tests/snapshots/aligned_view.png | 4 ++-- crates/maps/tests/snapshots/dense_grid_precision.png | 4 ++-- crates/maps/tests/snapshots/fixed_lens.png | 4 ++-- crates/maps/tests/snapshots/fixed_lens_background.png | 4 ++-- crates/maps/tests/snapshots/google_cartographer_example.png | 4 ++-- crates/maps/tests/snapshots/measurement.png | 4 ++-- crates/maps/tests/snapshots/nav2_example.png | 4 ++-- crates/maps/tests/snapshots/pixel_test.png | 2 +- crates/maps/tests/snapshots/reload_session_config.png | 4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/maps/src/grid.rs b/crates/maps/src/grid.rs index 4c688cb..a4784e6 100644 --- a/crates/maps/src/grid.rs +++ b/crates/maps/src/grid.rs @@ -349,7 +349,7 @@ impl Grid { coord > self.painter.clip_rect().min.x && coord < self.painter.clip_rect().max.x, ), LineDirection::Horizontal => ( - egui::Pos2::new(self.ui_offset.x, coord) + label_text_options.offset, + egui::Pos2::new(self.ui_offset.x, coord + stroke.width) + label_text_options.offset, (self.origin_in_points.y - coord) / self.points_per_meter, coord > self.painter.clip_rect().min.y && coord < self.painter.clip_rect().max.y, ), diff --git a/crates/maps/tests/snapshots/aligned_view.png b/crates/maps/tests/snapshots/aligned_view.png index 4abcf4d..bf5f1c3 100644 --- a/crates/maps/tests/snapshots/aligned_view.png +++ b/crates/maps/tests/snapshots/aligned_view.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5d744fb4b4e5feb21db188a1356c1632aeeb0dc9bf2b5062c1916bbb3e64d20d -size 73008 +oid sha256:6e21d7a73debe8d8e0aac5601bbe2bf1189f0220959b76245671804d911e82eb +size 72981 diff --git a/crates/maps/tests/snapshots/dense_grid_precision.png b/crates/maps/tests/snapshots/dense_grid_precision.png index 2422ff8..dc3e20a 100644 --- a/crates/maps/tests/snapshots/dense_grid_precision.png +++ b/crates/maps/tests/snapshots/dense_grid_precision.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ade2f7d14248538124f84cceddf8c6a4d98e80b40030bc0b09811248080223fe -size 69815 +oid sha256:c8ebbcf9470075e53795060e6d81830a2ff475f26fc2d5121d2c7fb0aa96da5b +size 69852 diff --git a/crates/maps/tests/snapshots/fixed_lens.png b/crates/maps/tests/snapshots/fixed_lens.png index fa37b3a..a8c6eef 100644 --- a/crates/maps/tests/snapshots/fixed_lens.png +++ b/crates/maps/tests/snapshots/fixed_lens.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7653312630f8b8d74e680d50e34e799d4dd074d2d330884c70621074f0f4916 -size 121346 +oid sha256:ec319ceea65e14b02a0059c821b20f1c5d574894a0b6497d98b429a1c4ea0468 +size 121131 diff --git a/crates/maps/tests/snapshots/fixed_lens_background.png b/crates/maps/tests/snapshots/fixed_lens_background.png index e76471e..b569132 100644 --- a/crates/maps/tests/snapshots/fixed_lens_background.png +++ b/crates/maps/tests/snapshots/fixed_lens_background.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef044fac0508db6a30aafc0a97d43fe6327a8c61f57ab7ce09e6c09d39584556 -size 84838 +oid sha256:40032e69c401f2b0b0f33879de1143aa0abec46d680ef5d8448aa0bd4d5ee2f7 +size 84878 diff --git a/crates/maps/tests/snapshots/google_cartographer_example.png b/crates/maps/tests/snapshots/google_cartographer_example.png index b1f533a..7ad45d0 100644 --- a/crates/maps/tests/snapshots/google_cartographer_example.png +++ b/crates/maps/tests/snapshots/google_cartographer_example.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0993f18f95d77a95415f306ec49af1a2910886e83a0f3e4330bd509733d2f895 -size 272423 +oid sha256:9fd0a5aedde493db275d220b87bd98d79c3dec41968f6197731f27ad827cf124 +size 272412 diff --git a/crates/maps/tests/snapshots/measurement.png b/crates/maps/tests/snapshots/measurement.png index b28cd3a..24c6385 100644 --- a/crates/maps/tests/snapshots/measurement.png +++ b/crates/maps/tests/snapshots/measurement.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d2be54121c47b3758d4129fe2927bc318b47c4cb27177ed59a93a93f94ba3472 -size 87691 +oid sha256:ba6e221497338db2705fe9ed0433de28cec1276be1cc1bb2f7bf7751213807b0 +size 87664 diff --git a/crates/maps/tests/snapshots/nav2_example.png b/crates/maps/tests/snapshots/nav2_example.png index b17d703..0837cba 100644 --- a/crates/maps/tests/snapshots/nav2_example.png +++ b/crates/maps/tests/snapshots/nav2_example.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:343d31db6c9c926170d76a333f779c02761ada30519ced9f61cba8feea00c3f9 -size 72534 +oid sha256:9ca90ae87787010abffefe22201bb17d2381dd1a68e639a765bd7409dda3f737 +size 72569 diff --git a/crates/maps/tests/snapshots/pixel_test.png b/crates/maps/tests/snapshots/pixel_test.png index 8c0673a..6a99366 100644 --- a/crates/maps/tests/snapshots/pixel_test.png +++ b/crates/maps/tests/snapshots/pixel_test.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb5cea10f85273bc2d6a44d10e2ca8238a5446d9637af8403cf9cc438061028f +oid sha256:4b849064831816fbdd0e9cef5852c2db94667a04e1dbd155889a4ddc7d5b3c75 size 36435 diff --git a/crates/maps/tests/snapshots/reload_session_config.png b/crates/maps/tests/snapshots/reload_session_config.png index b086039..5b27ef8 100644 --- a/crates/maps/tests/snapshots/reload_session_config.png +++ b/crates/maps/tests/snapshots/reload_session_config.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:644c54bef98efc1b4fb115b771e81a6b9158f8d8f38d27f19fe52af20b2f2b07 -size 261923 +oid sha256:21e2c107f83f0b6e43f4ce37c482b1f685cfa10df991e33566aafc34be5283c7 +size 261949