ISSUE-053 - Placed TimingBoard into the video feed element. But the scaling is messing with the clip path because the clip path values do not follow the scale correctly.

The issue is, say our scale is 50%. A PositionFlag on the TimingBoard is normally 32x32px in size. That means that the size of the actual PositionFlag while scaled is 16x16.

The WipeTransition component takes the effective size of its child element using the  useMeasure() hook. So it sees the size is 16x16, thus, when the wipe is set to visible its clip dimensions on the opposite and adjacent points of the triangle are 16px away from origin.

But because we're scaled at 50% that clip path effectively becomes 8px. The clip path is doubly scaled. As a result I'm seeing white squares in the corner of the PositionFlag component.

I think I might be able to solve this by using simple division to express the values of the clip path in percentages. Or I'll find a way to avoid the double scaling issue.
This commit is contained in:
Kyle Geib committed 2022-03-15 13:14:20 -05:00
1 parent d083df7245
commit b48579ac54
8 files changed
+28 -27

No files matched your search

@@ -5,14 +5,17 @@ import { workspaceSelector } from "../../../features/workspace/workspaceSelector
import { TimingBoardLayout } from "./styles";
import { TimingTower } from "./TimingTower";
import { StatusIndicator } from "./StatusIndicator";
import { broadcastGraphicsSelector } from "../../../features/broadcast/graphics/broadcastGraphicsSelector";
type TimingBoardProps = {
debug?: boolean,
};
export function TimingBoard({ debug = false }: TimingBoardProps) {
const { debugDurationMultiplier } = useSelector(workspaceSelector);
const { timingBoard } = useSelector(broadcastGraphicsSelector);
return (
<TimingBoardLayout>
<TimingBoardLayout placement={timingBoard.placement}>
<StatusIndicator
debugDurationMultiplier={debug ? debugDurationMultiplier : 1}
/>
@@ -1,7 +1,14 @@
import styled from "styled-components/macro";
export const TimingBoardLayout = styled.div`
import { Placement } from "../../../types/style";
import { placementStyleRules } from "../../../utils/styling";
type TimingBoardLayoutProps = {
placement: Placement,
};
export const TimingBoardLayout = styled.div<TimingBoardLayoutProps>`
position: relative;
${({ placement }) => placementStyleRules(placement)}
display: flex;
flex-direction: column;