Recoloured tracks now also show the colour in the background

This commit is contained in:
Moulberry committed 2024-12-18 17:55:05 -05:00
1 parent ebc5adfd10
commit 2f1cddcbc1
1 file changed
+12
@@ -1550,6 +1550,7 @@ public class TimelineWindow {
private static void renderKeyframeElements(float x, float y, int cursorTicks, int middleX) {
ImGui.setCursorScreenPos(x + 8, y + 6);
float lineHeight = ImGui.getTextLineHeightWithSpacing() + ImGui.getStyle().getItemSpacingY();
int keyframeTrackToClear = -1;
@@ -1603,6 +1604,17 @@ public class TimelineWindow {
ImGui.setCursorPosX(repositioningKeyframeTrack == trackIndex ? 3 : 2);
ImGui.setCursorPosY(ImGui.getCursorPosY() + trackOffset);
if (keyframeTrack.customColour != 0) {
int colour = keyframeTrack.customColour & 0xFFFFFF;
colour |= 0x30000000;
float rectY = y + 3 + trackIndex * lineHeight;
if (trackIndex == 0) {
rectY -= 1;
}
drawList.addRectFilled(x + middleX + 1, rectY, x + width,
y + 2 + trackIndex * lineHeight + lineHeight, colour);
}
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, 0, 0);
if (repositioningKeyframeTrack == trackIndex) {
ImGui.text("\ue945");