Skip to content

Commit

Permalink
Fix non-split case for split trajectories gradient (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja authored Jun 19, 2024
1 parent a27060e commit 8a041dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/config/robotconfig/PathGradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ 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.
*
* @param point - The current point in the trajectory.
* @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,
i: number,
arr: SavedTrajectorySample[],
documentModel: IStateStore
) {
return "yellow";
return "var(--select-yellow)";
}

/**
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 8a041dc

Please sign in to comment.