Skip to content

Commit 434eaa8

Browse files
committed
Don't render hold body if the head is lower than the tail. A scenario of this is when StopDrawingHoldBodyOffset is used.
1 parent 3ba8bd5 commit 434eaa8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/NoteDisplay.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,17 @@ void NoteDisplay::DrawHoldBodyInternal(vector<Sprite*>& sprite_top,
10361036
const float y_head, const float y_tail, const float top_beat,
10371037
const float bottom_beat, bool glow)
10381038
{
1039-
// Draw the body
1040-
part_args.y_top= y_head;
1041-
part_args.y_bottom= y_tail;
1042-
part_args.top_beat = top_beat;
1043-
part_args.bottom_beat= bottom_beat;
1044-
part_args.wrapping= true;
1045-
DrawHoldPart(sprite_body, field_args, column_args, part_args, glow, hpt_body);
1039+
// Draw the body if the start is not lower than the start of the tail
1040+
if (y_head < y_tail)
1041+
{
1042+
part_args.y_top = y_head;
1043+
part_args.y_bottom = y_tail;
1044+
part_args.top_beat = top_beat;
1045+
part_args.bottom_beat = bottom_beat;
1046+
part_args.wrapping = true;
1047+
DrawHoldPart(sprite_body, field_args, column_args, part_args, glow, hpt_body);
1048+
}
1049+
10461050
// Draw the bottom cap
10471051
part_args.y_top= y_tail;
10481052
part_args.y_bottom = tail_plus_bottom;

0 commit comments

Comments
 (0)