Skip to content

Commit

Permalink
cursorFrameの値が0より小さい場合に0として扱うように変更、TODOコメントを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sigprogramming committed Jan 16, 2025
1 parent f099185 commit d90a48c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sing/stateMachine/sequencerStateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ class IdleState implements IState<State, Input, Context> {
mouseButton === "LEFT_BUTTON" &&
input.targetArea === "SequencerBody"
) {
// TODO: Ctrlが押されているときではなく、
// ピッチ削除ツールのときにErasePitchStateに遷移するようにする
if (isOnCommandOrCtrlKeyDown(input.mouseEvent)) {
const erasePitchState = new ErasePitchState(
input.cursorPos,
Expand Down Expand Up @@ -1183,10 +1185,7 @@ class ErasePitchState implements IState<State, Input, Context> {
if (context.previewPitchEdit.value.type !== "erase") {
throw new Error("previewPitchEdit.value.type is not erase.");
}
const cursorFrame = this.currentCursorPos.frame;
if (cursorFrame < 0) {
return;
}
const cursorFrame = Math.max(0, this.currentCursorPos.frame);
const tempPitchEdit = { ...context.previewPitchEdit.value };

if (tempPitchEdit.startFrame > cursorFrame) {
Expand Down

0 comments on commit d90a48c

Please sign in to comment.