Fix an issue where the video size was not drawn correctly (#3047)
Fixed an issue where the video size was drawing larger than the shape size. After: ![スクリーンショット 2024-03-04 15 38 10](https://github.com/tldraw/tldraw/assets/20399854/5839f4a3-913b-4d3a-a816-003d58f89d50) Before: ![スクリーンショット 2024-03-04 15 37 32](https://github.com/tldraw/tldraw/assets/20399854/188bd0cb-50aa-4ea9-a0a5-7748d747eae0) ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan no tests ### Release Notes - Fix an issue where the video size was not drawn correctly. Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
This commit is contained in:
parent
ce782dc70b
commit
5e4bca9961
1 changed files with 30 additions and 27 deletions
|
@ -149,13 +149,14 @@ export class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
|
||||||
<>
|
<>
|
||||||
<HTMLContainer
|
<HTMLContainer
|
||||||
id={shape.id}
|
id={shape.id}
|
||||||
className="tl-video-container tl-counter-scaled"
|
|
||||||
style={{
|
style={{
|
||||||
color: 'var(--color-text-3)',
|
color: 'var(--color-text-3)',
|
||||||
backgroundColor: asset ? 'transparent' : 'var(--color-low)',
|
backgroundColor: asset ? 'transparent' : 'var(--color-low)',
|
||||||
border: asset ? 'none' : '1px solid var(--color-low-border)',
|
border: asset ? 'none' : '1px solid var(--color-low-border)',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<div className="tl-counter-scaled">
|
||||||
|
<div className="tl-video-container">
|
||||||
{asset?.props.src ? (
|
{asset?.props.src ? (
|
||||||
<video
|
<video
|
||||||
ref={rVideo}
|
ref={rVideo}
|
||||||
|
@ -182,6 +183,8 @@ export class VideoShapeUtil extends BaseBoxShapeUtil<TLVideoShape> {
|
||||||
) : (
|
) : (
|
||||||
<BrokenAssetIcon />
|
<BrokenAssetIcon />
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</HTMLContainer>
|
</HTMLContainer>
|
||||||
{'url' in shape.props && shape.props.url && (
|
{'url' in shape.props && shape.props.url && (
|
||||||
<HyperlinkButton url={shape.props.url} zoomLevel={editor.getZoomLevel()} />
|
<HyperlinkButton url={shape.props.url} zoomLevel={editor.getZoomLevel()} />
|
||||||
|
|
Loading…
Reference in a new issue