Skip to content

Commit

Permalink
no padding
Browse files Browse the repository at this point in the history
  • Loading branch information
podusowski committed Aug 8, 2023
1 parent 9dbcf21 commit 6c12b46
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions examples/myapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,46 @@ impl MyApp {

impl eframe::App for MyApp {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
// Typically this would be a GPS acquired position which is tracked by the map.
let my_position = places::wroclaw_glowny();

// In egui, widgets are constructed and consumed in each frame.
let map = Map::new(Some(&mut self.tiles), &mut self.map_memory, my_position);

// Optionally, a function which draw custom stuff on the map can be attached.
let ctx_clone = ctx.clone();
let map = map.with_drawer(move |painter, project| {
draw_custom_shapes(ctx_clone.clone(), painter, project);
});
let rimless = egui::Frame {
fill: ctx.style().visuals.panel_fill,
..Default::default()
};

egui::CentralPanel::default()
.frame(rimless)
.show(ctx, |ui| {
// Typically this would be a GPS acquired position which is tracked by the map.
let my_position = places::wroclaw_glowny();

// In egui, widgets are constructed and consumed in each frame.
let map = Map::new(Some(&mut self.tiles), &mut self.map_memory, my_position);

// Optionally, a function which draw custom stuff on the map can be attached.
let ctx_clone = ctx.clone();
let map = map.with_drawer(move |painter, project| {
draw_custom_shapes(ctx_clone.clone(), painter, project);
});

// Draw the map widget.
ui.add(map);
// Draw the map widget.
ui.add(map);

// Draw utility windows.
{
use windows::*;
// Draw utility windows.
{
use windows::*;

zoom(ui, &mut self.map_memory);
go_to_my_position(ui, &mut self.map_memory);
zoom(ui, &mut self.map_memory);
go_to_my_position(ui, &mut self.map_memory);

orthophotomap(
ui,
&mut self.geoportal_tiles,
&mut self.map_memory,
my_position,
);
orthophotomap(
ui,
&mut self.geoportal_tiles,
&mut self.map_memory,
my_position,
);

acknowledge(ui);
}
});
acknowledge(ui);
}
});
}
}

Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c12b46

Please sign in to comment.