mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix/last date of existing card should not be positive in simulation (#3667)
* Fix/last date of existing card should not be positive in simulation * update fsrs-rs to v1.4.9 * ./ninja fix:minilints
This commit is contained in:
parent
aaf8b4dddb
commit
39bf29e1a6
1 changed files with 2 additions and 1 deletions
|
@ -75,10 +75,11 @@ impl Card {
|
||||||
CardQueue::DayLearn | CardQueue::Review => {
|
CardQueue::DayLearn | CardQueue::Review => {
|
||||||
let due = card.original_or_current_due();
|
let due = card.original_or_current_due();
|
||||||
let relative_due = due - days_elapsed;
|
let relative_due = due - days_elapsed;
|
||||||
|
let last_date = (relative_due - card.interval as i32).min(0) as f32;
|
||||||
Some(fsrs::Card {
|
Some(fsrs::Card {
|
||||||
difficulty: state.difficulty,
|
difficulty: state.difficulty,
|
||||||
stability: state.stability,
|
stability: state.stability,
|
||||||
last_date: (relative_due - card.interval as i32) as f32,
|
last_date,
|
||||||
due: relative_due as f32,
|
due: relative_due as f32,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue