fix undo for digit tile placement
This commit is contained in:
parent
64fb7ca5ba
commit
73a1c62f52
2 changed files with 4 additions and 6 deletions
|
@ -120,7 +120,6 @@ pub enum ExitState {
|
|||
Dont,
|
||||
ExitAndSave,
|
||||
Save,
|
||||
ExitNoSave,
|
||||
}
|
||||
|
||||
impl Editor {
|
||||
|
@ -1087,10 +1086,10 @@ impl Editor {
|
|||
Tool::Mirror => self.set_tile(pos, Tile::Mirror(self.tool_mirror)),
|
||||
Tool::Digits(_pos) => {
|
||||
self.active_tool = Tool::Digits(Some(pos));
|
||||
if let Some(tile) = self.source_board.get_mut(pos) {
|
||||
if !matches!(tile, Tile::Open(OpenTile::Digit(_), _)) {
|
||||
*tile = Tile::Open(OpenTile::Digit(0), Claim::Free);
|
||||
}
|
||||
|
||||
let tile = self.source_board.get_or_blank(pos);
|
||||
if !matches!(tile, Tile::Open(OpenTile::Digit(_), _)) {
|
||||
self.set_tile(pos, Tile::Open(OpenTile::Digit(0), Claim::Free));
|
||||
}
|
||||
}
|
||||
Tool::Blueprint => {
|
||||
|
|
|
@ -97,7 +97,6 @@ impl Game {
|
|||
solution.score = editor.score();
|
||||
solution.save();
|
||||
}
|
||||
ExitState::ExitNoSave => self.open_editor = None,
|
||||
}
|
||||
} else {
|
||||
self.draw(&mut d);
|
||||
|
|
Loading…
Reference in a new issue