Minor fix

* Fix selection error when use delete after to delete the last tas unit
* Fix sel_rect display error
* Add some documents
* Fix layout becoming confusing when secondly open file.
This commit is contained in:
2021-09-22 13:33:57 +08:00
parent 0534b22501
commit b506dafcbd
9 changed files with 72 additions and 28 deletions

View File

@ -34,8 +34,16 @@ namespace BallanceTASEditor.UI {
}
public void UpdateRange(TASFile mFile) {
components.mSlider.Maximum = mFile.mFrameCount - 1;
components.mSlider.Value = mFile.GetPointerIndex();
components.mSlider.Maximum = mFile.mFrameCount == 0 ? 0 : mFile.mFrameCount - 1;
var index = mFile.GetPointerIndex();
if (index >= 0) {
components.mSlider.Value = mFile.GetPointerIndex();
components.mSlider.IsEnabled = true;
} else {
// invalid index, mean slider is useless, disable it
components.mSlider.Value = components.mSlider.Maximum;
components.mSlider.IsEnabled = false;
}
}
private void func_SliderValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {