Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two small fixes #79

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions walkers/src/download.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use egui::Context;
use futures::StreamExt;
use futures::{SinkExt, StreamExt};
use image::ImageError;
use reqwest::header::USER_AGENT;

Expand Down Expand Up @@ -59,7 +59,7 @@ where

match download_and_decode(&client, &url, &egui_ctx).await {
Ok(tile) => {
tile_tx.try_send((request, tile)).map_err(|_| ())?;
tile_tx.send((request, tile)).await.map_err(|_| ())?;
egui_ctx.request_repaint();
}
Err(e) => {
Expand Down
2 changes: 1 addition & 1 deletion walkers/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl Map<'_, '_> {

// Zooming and dragging need to be exclusive, otherwise the map will get dragged when
// pinch gesture is used.
if !(0.99..=1.01).contains(&zoom_delta) {
if !(0.99..=1.01).contains(&zoom_delta) && ui.ui_contains_pointer() {
// Displacement of mouse pointer relative to widget center
let offset = response.hover_pos().map(|p| p - response.rect.center());

Expand Down
4 changes: 3 additions & 1 deletion walkers/src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ impl Tiles {
Err(_) => {
// Just ignore. It means that no new tile was downloaded.
}
Ok(None) => panic!("IO thread is dead"),
Ok(None) => {
log::error!("IO thread is dead")
}
}

match self.cache.entry(tile_id) {
Expand Down
Loading