Skip to content

Commit

Permalink
targetAreaを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sigprogramming committed Feb 10, 2025
1 parent a64fb0c commit 472da41
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 10 deletions.
8 changes: 7 additions & 1 deletion src/sing/sequencerStateMachine/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ export type PositionOnSequencer = {
export type Input =
| {
readonly type: "keyboardEvent";
readonly targetArea: "SequencerBody";
readonly targetArea: "Document";
readonly keyboardEvent: KeyboardEvent;
}
| {
readonly type: "mouseEvent";
readonly targetArea: "Window";
readonly mouseEvent: MouseEvent;
readonly cursorPos: PositionOnSequencer;
}
| {
readonly type: "mouseEvent";
readonly targetArea: "SequencerBody";
Expand Down
2 changes: 1 addition & 1 deletion src/sing/sequencerStateMachine/states/addNoteState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class AddNoteState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
2 changes: 1 addition & 1 deletion src/sing/sequencerStateMachine/states/drawPitchState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class DrawPitchState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export class EditNotesToolIdleState
const mouseButton = getButton(input.mouseEvent);
const selectedTrackId = context.selectedTrackId.value;

if (input.targetArea === "SequencerBody") {
if (
input.targetArea === "Window" &&
input.mouseEvent.type === "mousemove"
) {
context.guideLineTicks.value = getGuideLineTicks(
input.cursorPos,
context,
Expand Down
2 changes: 1 addition & 1 deletion src/sing/sequencerStateMachine/states/erasePitchState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class ErasePitchState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
2 changes: 1 addition & 1 deletion src/sing/sequencerStateMachine/states/moveNoteState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class MoveNoteState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ResizeNoteLeftState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class ResizeNoteRightState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.innerContext.executePreviewProcess = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export class SelectNotesToolIdleState
const mouseButton = getButton(input.mouseEvent);
const selectedTrackId = context.selectedTrackId.value;

if (input.targetArea === "SequencerBody") {
if (
input.targetArea === "Window" &&
input.mouseEvent.type === "mousemove"
) {
context.guideLineTicks.value = getGuideLineTicks(
input.cursorPos,
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class SelectNotesWithRectState
if (input.type === "mouseEvent") {
const mouseButton = getButton(input.mouseEvent);

if (input.targetArea === "SequencerBody") {
if (input.targetArea === "Window") {
if (input.mouseEvent.type === "mousemove") {
this.currentCursorPos = input.cursorPos;
this.updatePreviewRect(context);
Expand Down

0 comments on commit 472da41

Please sign in to comment.