properly center editor view and make zoom follow mouse position
This commit is contained in:
parent
355a5af15e
commit
82d0ff0f37
3 changed files with 40 additions and 9 deletions
|
@ -213,7 +213,9 @@ impl Game {
|
|||
d.draw_text(solution.id(), column_x, y + 35, 10, Color::GRAY);
|
||||
|
||||
if simple_button(d, column_x, y + 50, 220, 30) {
|
||||
self.open_editor = Some(Editor::new(solution.clone(), level.clone()));
|
||||
let mut editor = Editor::new(solution.clone(), level.clone());
|
||||
editor.center_view(d);
|
||||
self.open_editor = Some(editor);
|
||||
}
|
||||
d.draw_text("edit", column_x + 5, y + 55, 20, Color::WHITE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue