@revideo/2d 0.5.4 → 0.5.5-alpha.1065
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/editor/editor/tsconfig.build.tsbuildinfo +1 -1
- package/lib/components/Layout.d.ts +1 -0
- package/lib/components/Layout.d.ts.map +1 -1
- package/lib/components/Layout.js +9 -2
- package/lib/components/TxtLeaf.js +2 -2
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/lib/components/Layout.ts +11 -0
- package/src/lib/components/Txt.test.tsx +2 -0
- package/src/lib/components/TxtLeaf.ts +1 -1
- package/src/lib/components/__tests__/clone.test.tsx +1 -0
- package/src/lib/components/__tests__/state.test.tsx +1 -0
|
@@ -10,6 +10,7 @@ describe('Txt', () => {
|
|
|
10
10
|
|
|
11
11
|
it('Handle plain text', () => {
|
|
12
12
|
const node = (<Txt lineWidth={8}>test</Txt>) as Txt;
|
|
13
|
+
node.toPromise();
|
|
13
14
|
|
|
14
15
|
const parseSpy = vi.spyOn(node as any, 'parseChildren');
|
|
15
16
|
const leaf = node.childAs<TxtLeaf>(0);
|
|
@@ -38,6 +39,7 @@ describe('Txt', () => {
|
|
|
38
39
|
Apple <Txt>Banana</Txt> Cherry
|
|
39
40
|
</Txt>
|
|
40
41
|
) as Txt;
|
|
42
|
+
node.toPromise();
|
|
41
43
|
|
|
42
44
|
const first = node.childAs<TxtLeaf>(0);
|
|
43
45
|
const second = node.childAs<Txt>(1);
|
|
@@ -61,9 +61,9 @@ export class TxtLeaf extends Shape {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
protected override async draw(context: CanvasRenderingContext2D) {
|
|
64
|
-
await document.fonts?.ready;
|
|
65
64
|
this.requestFontUpdate();
|
|
66
65
|
this.applyStyle(context);
|
|
66
|
+
await document.fonts?.ready;
|
|
67
67
|
this.applyText(context);
|
|
68
68
|
context.font = this.styles.font;
|
|
69
69
|
if ('letterSpacing' in context) {
|