@revideo/2d 0.5.3-alpha.1053 → 0.5.3-alpha.1054

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revideo/2d",
3
- "version": "0.5.3-alpha.1053+0b4a0cac",
3
+ "version": "0.5.3-alpha.1054+4289d2f0",
4
4
  "description": "A 2D renderer for revideo",
5
5
  "author": "revideo",
6
6
  "homepage": "https://re.video/",
@@ -30,7 +30,7 @@
30
30
  "devDependencies": {
31
31
  "@preact/signals": "^1.2.1",
32
32
  "@revideo/internal": "^0.0.0",
33
- "@revideo/ui": "^0.5.3-alpha.1053+0b4a0cac",
33
+ "@revideo/ui": "^0.5.3-alpha.1054+4289d2f0",
34
34
  "clsx": "^2.0.0",
35
35
  "jsdom": "^22.1.0",
36
36
  "preact": "^10.19.2",
@@ -40,7 +40,7 @@
40
40
  "@codemirror/language": "^6.10.1",
41
41
  "@lezer/common": "^1.2.1",
42
42
  "@lezer/highlight": "^1.2.0",
43
- "@revideo/core": "^0.5.3-alpha.1053+0b4a0cac",
43
+ "@revideo/core": "^0.5.3-alpha.1054+4289d2f0",
44
44
  "@rive-app/canvas-advanced": "2.7.3",
45
45
  "code-fns": "^0.8.2",
46
46
  "hls.js": "^1.5.11",
@@ -48,5 +48,5 @@
48
48
  "mp4box": "^0.5.2",
49
49
  "parse-svg-path": "^0.1.2"
50
50
  },
51
- "gitHead": "0b4a0cac9899525dcb393594338c1af3f9ed3d9c"
51
+ "gitHead": "4289d2f09de68ed31eda222da66d86c62d0adb5f"
52
52
  }
@@ -992,13 +992,25 @@ export class Layout extends Node {
992
992
 
993
993
  if (this.textWrap.isInitial()) {
994
994
  this.element.style.whiteSpace = '';
995
- } else {
996
- const wrap = this.textWrap();
997
- if (typeof wrap === 'boolean') {
998
- this.element.style.whiteSpace = wrap ? 'normal' : 'nowrap';
999
- } else {
1000
- this.element.style.whiteSpace = wrap;
1001
- }
995
+ return;
996
+ }
997
+
998
+ const wrap = this.textWrap();
999
+
1000
+ if (typeof wrap === 'boolean') {
1001
+ this.element.style.whiteSpace = wrap ? 'normal' : 'nowrap';
1002
+ return;
1003
+ }
1004
+
1005
+ if (wrap === 'pre') {
1006
+ this.element.style.whiteSpace = wrap;
1007
+ return;
1008
+ }
1009
+
1010
+ if (wrap === 'balance') {
1011
+ this.element.style.whiteSpace = 'normal';
1012
+ this.element.style.textWrap = wrap;
1013
+ return;
1002
1014
  }
1003
1015
  }
1004
1016
 
@@ -25,7 +25,7 @@ export type FlexContent =
25
25
 
26
26
  export type FlexItems = 'center' | 'start' | 'end' | 'stretch' | 'baseline';
27
27
 
28
- export type TextWrap = boolean | 'pre';
28
+ export type TextWrap = boolean | 'pre' | 'balance';
29
29
 
30
30
  export type LayoutMode = boolean | null;
31
31
 
@@ -56,7 +56,7 @@ export class Segment {
56
56
  const segmentDurationInSeconds =
57
57
  this.edit.segmentDuration /
58
58
  this.file.getInfo().videoTracks[0].movie_timescale;
59
- const framesToFill = Math.ceil(segmentDurationInSeconds * this.edit.fps);
59
+ const framesToFill = segmentDurationInSeconds * this.edit.fps;
60
60
 
61
61
  const height = this.file.getInfo().videoTracks[0].track_height;
62
62
  const width = this.file.getInfo().videoTracks[0].track_width;