Skip to content

Commit 94bfec6

Browse files
committed
feat: resize操作判定范围调整
1 parent 99d68c5 commit 94bfec6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

TuneLab/UI/MainWindow/Editor/PianoWindow/PianoScrollView/PianoScrollViewItem.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ class NoteStartResizeItem(PianoScrollView pianoScrollView) : PianoScrollViewItem
4343
public override bool Raycast(Avalonia.Point point)
4444
{
4545
double x = PianoScrollView.TickAxis.Tick2X(Note.GlobalStartPos());
46-
double left = x - 8;
47-
double right = x + 8;
46+
double left = x - 4;
47+
double right = x + 4;
4848
var last = Note.Last;
4949
if (last != null && last.Pitch.Value == Note.Pitch.Value)
5050
{
@@ -64,8 +64,8 @@ class NoteEndResizeItem(PianoScrollView pianoScrollView) : PianoScrollViewItem(p
6464
public override bool Raycast(Avalonia.Point point)
6565
{
6666
double x = PianoScrollView.TickAxis.Tick2X(Note.GlobalEndPos());
67-
double left = x - 8;
68-
double right = x + 8;
67+
double left = x - 4;
68+
double right = x + 4;
6969
double top = PianoScrollView.PitchAxis.Pitch2Y(Note.Pitch.Value + 1);
7070
double bottom = PianoScrollView.PitchAxis.Pitch2Y(Note.Pitch.Value);
7171
return point.Y >= top && point.Y <= bottom && point.X >= left && point.X <= right;
@@ -167,7 +167,7 @@ class VibratoStartResizeItem(PianoScrollView pianoScrollView) : PianoScrollViewI
167167
public override bool Raycast(Point point)
168168
{
169169
double x = PianoScrollView.TickAxis.Tick2X(Vibrato.GlobalStartPos());
170-
return point.X > x - 8 && point.X < x + 8;
170+
return point.X > x - 4 && point.X < x + 4;
171171
}
172172
}
173173

@@ -178,7 +178,7 @@ class VibratoEndResizeItem(PianoScrollView pianoScrollView) : PianoScrollViewIte
178178
public override bool Raycast(Point point)
179179
{
180180
double x = PianoScrollView.TickAxis.Tick2X(Vibrato.GlobalEndPos());
181-
return point.X > x - 8 && point.X < x + 8;
181+
return point.X > x - 4 && point.X < x + 4;
182182
}
183183
}
184184

0 commit comments

Comments
 (0)