[libshumate] Fix bug in symbol layer when rotating the map
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] Fix bug in symbol layer when rotating the map
- Date: Sat, 27 Aug 2022 20:37:27 +0000 (UTC)
commit a35189d4ae21f7dbeaff0b49d57132693388e2a8
Author: James Westman <james jwestman net>
Date: Thu Aug 18 10:57:02 2022 -0500
Fix bug in symbol layer when rotating the map
There was a bug where symbols would be misplaced when rotating the map
due to shadowed variables.
shumate/vector/shumate-vector-symbol-container.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/shumate/vector/shumate-vector-symbol-container.c
b/shumate/vector/shumate-vector-symbol-container.c
index a18ba8a..a591bc3 100644
--- a/shumate/vector/shumate-vector-symbol-container.c
+++ b/shumate/vector/shumate-vector-symbol-container.c
@@ -215,14 +215,14 @@ shumate_vector_symbol_container_size_allocate (GtkWidget *widget,
float tile_size_at_zoom = tile_size * powf (2, zoom_level - child->zoom);
float x = (child->tile_x + child->x) * tile_size_at_zoom - center_x + width/2.0;
float y = (child->tile_y + child->y) * tile_size_at_zoom - center_y + height/2.0;
- int width, height;
+ int child_width, child_height;
gtk_widget_set_child_visible (GTK_WIDGET (child->symbol), child->marker->visible);
if (!child->marker->visible)
continue;
- gtk_widget_measure (GTK_WIDGET (child->symbol), GTK_ORIENTATION_HORIZONTAL, -1, NULL, &width, NULL,
NULL);
- gtk_widget_measure (GTK_WIDGET (child->symbol), GTK_ORIENTATION_VERTICAL, -1, NULL, &height, NULL,
NULL);
+ gtk_widget_measure (GTK_WIDGET (child->symbol), GTK_ORIENTATION_HORIZONTAL, -1, NULL, &child_width,
NULL, NULL);
+ gtk_widget_measure (GTK_WIDGET (child->symbol), GTK_ORIENTATION_VERTICAL, -1, NULL, &child_height,
NULL, NULL);
rotate_around_center (&x, &y, width, height, rotation);
alloc.x = x - child->width/2.0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]