Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnei committed Sep 2, 2024
2 parents 352f882 + 5c9bad0 commit e1afda1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Wait for previous workflows to finish
uses: softprops/turnstyle@v1
uses: softprops/turnstyle@v2
with:
same-branch-only: false
env:
Expand Down
6 changes: 3 additions & 3 deletions src/main/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Header() {
}

const LogoPicture: React.FC = () => {
const path = (filename:string) => import.meta.env.BASE_URL + filename;
const imgUrl = new URL("/public/opencast-editor.svg", import.meta.url).href;
return (
<div>
<picture css={{
Expand All @@ -101,8 +101,8 @@ const LogoPicture: React.FC = () => {
height: "calc(100% - 0.5px)",
},
}}>
<source srcSet={path("opencast-editor.svg")}></source>
<img src={path("opencast-editor.svg")} alt="Opencast Editor Logo"/>
<source srcSet={imgUrl}></source>
<img src={imgUrl} alt="Opencast Editor Logo"/>
</picture>
</div>
);
Expand Down
23 changes: 4 additions & 19 deletions src/main/SubtitleTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,13 @@ const TimelineSubtitleSegment: React.FC<{
const onResizeAbsolute: ResizableProps["onResize"] = (_event, { size, handle }) => {
// Possible TODO: Find a way to stop resizing a segment beyond 0ms here instead of later
let newLeft = absoluteLeft;
let newTop = absoluteTop;
const deltaHeight = size.height - absoluteHeight;
const deltaWidth = size.width - absoluteWidth;
if (handle[0] === "n") {
newTop -= deltaHeight;
} else if (handle[0] === "s") {
newTop += deltaHeight;
}

if (handle[handle.length - 1] === "w") {
newLeft -= deltaWidth;
} else if (handle[handle.length - 1] === "e") {
newLeft += deltaWidth;
newLeft -= size.width - absoluteWidth;
}

setAbsoluteWidth(size.width);
setAbsoluteHeight(size.height);
setAbsoluteLeft(newLeft);
setAbsoluteTop(newTop);
};

// Update redux state based on the resize
Expand All @@ -323,7 +312,7 @@ const TimelineSubtitleSegment: React.FC<{
}
// if handle === right, update endTime
if (handle === "e") {
newEndTime = props.cue.endTime + timeDiff;
newEndTime = props.cue.endTime - timeDiff;
}

dispatchNewTimes(newStartTime, newEndTime);
Expand Down Expand Up @@ -407,11 +396,7 @@ const TimelineSubtitleSegment: React.FC<{
width={absoluteWidth}
onResize={onResizeAbsolute}
onResizeStop={onResizeStop}
// TODO: The "e" handle is currently NOT WORKING CORRECTLY!
// The errounous behaviour can already be seens with a minimal
// draggable + resizable example.
// Fix most likely requires changes in one of those modules
resizeHandles={["w"]}
resizeHandles={["w", "e"]}
>
<div css={segmentStyle} ref={nodeRef} onClick={onClick} className="prevent-drag-scroll">
<span css={textStyle}>{props.cue.text}</span>
Expand Down

0 comments on commit e1afda1

Please sign in to comment.