@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.
@@ -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) {
@@ -52,6 +52,7 @@ describe('clone', () => {
52
52
  const template = (
53
53
  <Circle lineWidth={8} startAngle={signal} end={0.5} />
54
54
  ) as Circle;
55
+ template.toPromise();
55
56
  const clone = template.snapshotClone({end: 0});
56
57
 
57
58
  expect(clone.lineWidth()).toBe(8);
@@ -12,6 +12,7 @@ describe('state', () => {
12
12
  const circle = (
13
13
  <Circle lineWidth={8} startAngle={signal} end={0.5} />
14
14
  ) as Circle;
15
+ circle.toPromise();
15
16
  circle.save();
16
17
 
17
18
  circle.lineWidth(16);