Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Commit

Permalink
chore: change some path error.
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepbox8646 committed Jun 30, 2024
1 parent f6b70f5 commit 3beacea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { GlobalPlugin } from './plugin'
import { type Config, defineConfig } from './config'

/**
* A object that control a single animatiopn canvas.
* A object that control a single animation canvas.
*/
export class App {
/**
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/local-app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Canvas, CanvasKit, Surface } from 'canvaskit-wasm'
import type { Scene } from './scene'
import type { Widget } from './widget'
import type { GlobalPlugin } from './plugin'
import { type Config, defineConfig } from './config'

Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/widget.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { Canvas, CanvasKit } from 'canvaskit-wasm'
import { type BlendMode, deepClone, isUndefined } from '@newcar/utils'
import type { ConvertToProp } from './apis/types'
import type { Anim } from './animation'
import type { Event, EventInstance } from './event'
import { defineEvent } from './event'
import type { WidgetPlugin } from './plugin'
import type { ConvertToProp, Ref } from './prop'
import { changed, ref } from './prop'
import type { Ref } from './apis/ref'
import { ref } from './apis/ref'
import { changed } from './apis/changed'
import type { Position } from './apis/physical'
import { rp } from './apis/physical'
import { RootWidget } from './scene'
Expand Down Expand Up @@ -119,7 +121,7 @@ export class Widget {
[this.x.value, this.y.value] = this.pos.value.resolve(this.parent?.x.value ?? 0, this.parent?.y.value ?? 0)
}

changed(this.pos, (pos) => {
changed(this.pos, (pos: Ref<Position>) => {
if (this.parent instanceof RootWidget) {
[this.x.value, this.y.value] = pos.value.resolve(...this.parent.canvasSize)
}
Expand All @@ -139,6 +141,8 @@ export class Widget {
/**
* Update the object according to the style of the widget.
* Called when the style is changed.
* @param elapsed The elapsed time.
* @param ck The CanvasKit-WASM Namespace.
* @param canvas The canvas object of CanvasKit-WASM.
*/
update(
Expand Down

0 comments on commit 3beacea

Please sign in to comment.