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

@@ -71,7 +71,7 @@ export function ChyronsDirectorControls() {
}
const newChyrons: BGChyrons = {
openState: 0,
relativePos: { top: "0", right: "0", bottom: "0", left: "0" },
placement: { top: "0", right: "0", bottom: "0", left: "0" },
mode: chyronMode,
subMode: chyronSubMode,
driver: {
+2 -3
View File
@@ -1,6 +1,7 @@
import { MockupBlock } from "../../Common/MockupBlock.styled";
import VideoFeed from "../VideoFeed/VideoFeed";
import { LayoutGrid, LayoutGridItem } from "../../Common/LayoutGrid.styled";
import { TimingTowerPrototypeControls } from "../../Workspaces/PrototypingControls/TimingTowerPrototype";
type LayoutProps = {
headerHeight?: number,
@@ -33,9 +34,7 @@ export function Layout({ headerHeight }: LayoutProps) {
</LayoutGridItem>
<LayoutGridItem column={2} row={7} columnSpan={5} rowSpan={4}>
<MockupBlock
color="#4d828b"
>Broadcast Director UI</MockupBlock>
<TimingTowerPrototypeControls />
</LayoutGridItem>
</LayoutGrid>
);
@@ -4,7 +4,7 @@ import { calculateFitSize, calculateScale } from "../../../utils/styling";
import { theme } from "../../../shared/theme";
import { VideoFeedFrame, BackgroundImageDiv, DimensionsSpan, BroadcastLayout } from "./styles";
import { MockupBlock } from "../../Common/MockupBlock.styled";
import { TimingBoard } from "../../BroadcastGraphics/TimingBoard";
import bg from "../../../public/images/misc/bg-standin.jpg";
@@ -31,11 +31,7 @@ export default function VideoFeed() {
</DimensionsSpan>
<BackgroundImageDiv src={bg} />
<BroadcastLayout width={broadcastWidth} height={broadcastHeight} scale={layoutScale} >
<MockupBlock
width="300px"
height="900px"
color="grey"
/>
<TimingBoard />
</BroadcastLayout>
</VideoFeedFrame>
);
@@ -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;
+7 -5
View File
@@ -1,17 +1,19 @@
import { keys } from "lodash";
import { BGChyronSubMode, BGChyronMode, BGRelativePos, FlagMode } from "../../types/state";
import { BGChyronSubMode, BGChyronMode, FlagMode } from "../../types/state";
import { Placement } from "../../types/style";
// Chyrons Section
const chyronsData: {
[mode: BGChyronMode]: {
relativePos: BGRelativePos,
placement: Placement,
subModes: {
[subMode: BGChyronSubMode]: Record<string, unknown>,
},
},
} = {
driver: {
relativePos: { top: "0", right: "0", bottom: "0", left: "0" },
placement: { top: "0", right: "0", bottom: "0", left: "0" },
subModes: {
medium: { width: 582, height: 72 },
large: { width: 638, height: 98 },
@@ -25,8 +27,8 @@ export function getChyronModesList(): Array<BGChyronMode> {
return keys(chyronsData);
}
export function getChyronRelativePos(mode: BGChyronMode): BGRelativePos {
return chyronsData[mode]?.relativePos
export function getChyronRelativePos(mode: BGChyronMode): Placement {
return chyronsData[mode]?.placement
?? { top: "0", right: "0", bottom: "0", left: "0" };
}
@@ -13,8 +13,8 @@ import {
const initialState: RootState["broadcastGraphics"] = {
chyrons: null,
timingBoard: {
relativePos: {},
openState: 0,
placement: { top: "54px", left: "96px" },
openState: 1,
statusIndicator: {
mode: BGStatusIndicatorModes.LapNarrow,
},
+2 -8
View File
@@ -1,5 +1,5 @@
import { Meters, Milliseconds, Optional } from "./util";
import { Corner, Fraction } from "./style";
import { Corner, Fraction, Placement } from "./style";
export interface RootState {
pageDimensions: PageDimensions;
@@ -253,14 +253,8 @@ export interface BroadcastDirector {
}
// Broadcast Graphics
export interface BGRelativePos {
top?: string;
right?: string;
bottom?: string;
left?: string;
}
export interface BGBaseState {
relativePos: BGRelativePos;
placement: Placement;
openState: OpenState;
}
/**