From 8a041dc41705810a0dc572f7b3ba653099c96f4d Mon Sep 17 00:00:00 2001 From: shueja <32416547+shueja@users.noreply.github.com> Date: Tue, 18 Jun 2024 22:15:28 -0700 Subject: [PATCH] Fix non-split case for split trajectories gradient (#499) --- src/components/config/robotconfig/PathGradient.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/config/robotconfig/PathGradient.tsx b/src/components/config/robotconfig/PathGradient.tsx index 9e9fe70f4..82515da64 100644 --- a/src/components/config/robotconfig/PathGradient.tsx +++ b/src/components/config/robotconfig/PathGradient.tsx @@ -37,7 +37,7 @@ export type PathGradient = { */ class PathGradientFunctions { /** - * Returns the color "yellow" for the given point in the trajectory. + * Returns the "select-yellow" color for the given point in the trajectory. * This is the default color used when no gradient is applied. * NOTE: This function is not used and is included only for completeness. * @@ -45,7 +45,7 @@ class PathGradientFunctions { * @param i - The index of the current point in the trajectory. * @param arr - The array of all points in the trajectory. * @param documentModel - The document model object. - * @returns The color "yellow". + * @returns The "select-yellow" color. */ static none( point: SavedTrajectorySample, @@ -53,7 +53,7 @@ class PathGradientFunctions { arr: SavedTrajectorySample[], documentModel: IStateStore ) { - return "yellow"; + return "var(--select-yellow)"; } /** @@ -200,6 +200,9 @@ class PathGradientFunctions { arr: SavedTrajectorySample[], documentModel: IStateStore ) { + if (!documentModel.document.splitTrajectoriesAtStopPoints) { + return "var(--select-yellow)"; + } const stopPointControlIntervals = documentModel.document.pathlist.activePath.stopPointIndices();