Skip to content

Commit

Permalink
fix: timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Mond1c committed Oct 26, 2024
1 parent 891b2f7 commit 70298cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const Problem = ({ problemResult, contestInfo, animationKey }) => {
const problemsCount = contestInfo?.problems.length;
const height = Math.max(c.TIMELINE_WRAP_HEIGHT - 2 * c.TIMELINE_PADDING - c.TIMELINE_ELEMENT_DIAMETER, 0);
const top = height / (problemsCount - 1) * problemNumber + c.TIMELINE_PADDING + c.TIMELINE_ELEMENT_DIAMETER / 2;
const left = (100 * problemResult.time / contestLengthMs) * c.TIMELINE_REAL_WIDTH + 1.5;
const left = (100 * problemResult.time / contestLengthMs + c.TIMELINE_LEFT_TIME_PADDING) * c.TIMELINE_REAL_WIDTH;
const color = getColor(problemResult, contestInfo);
const letter = useAppSelector((state) => state.contestInfo.info?.problemsId[problemResult.problemId].letter);

Expand Down Expand Up @@ -239,7 +239,7 @@ export const TimeLine = ({ teamId, className = null }) => {
{Array.from(Array((Math.floor((contestInfo?.contestLengthMs ?? 0) / 3600000) + 1)).keys()).map(elem => {
return (<TimeBorder key={elem}
color={teamData?.color ?? "#000"}
left={(((elem) * 3600000 / contestInfo?.contestLengthMs * 100) * c.TIMELINE_REAL_WIDTH + (elem === 0 ? c.TIMELINE_LEFT_TIME_PADDING : 0)) + "%"} />); })}
left={(((elem) * 3600000 / contestInfo?.contestLengthMs * 100 + c.TIMELINE_LEFT_TIME_PADDING) * c.TIMELINE_REAL_WIDTH) + "%"} />); })}
{runsResults?.map((problemResult, index) => (
<Problem problemResult={problemResult} contestInfo={contestInfo} key={`${animationKey}-${index}`}
animationKey={animationKey}/>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/overlay/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ config.TIMELINE_BORDER_RADIUS = config.GLOBAL_BORDER_RADIUS;
config.TIMELINE_LINE_HEIGHT = "3%";
config.TIMELINE_WRAP_HEIGHT = 148;
config.TIMELINE_TIMEBORDER_COLOR = "#FFF";
config.TIMELINE_REAL_WIDTH = 0.983;
config.TIMELINE_REAL_WIDTH = 0.97;
config.TIMELINE_PADDING = 0;
config.TIMELINE_LEFT_TIME_PADDING = 1.37;

Expand Down

0 comments on commit 70298cc

Please sign in to comment.