Skip to content

Commit

Permalink
chore: 修复ci (#315)
Browse files Browse the repository at this point in the history
* chore(release): release

* chore: 修复ci

---------

Co-authored-by: xuying.xu <xuying.xu@alibaba-inc.com>
  • Loading branch information
tangying1027 and xuying.xu authored Feb 13, 2025
1 parent d45d060 commit 2c47995
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node_version: ['18', '19']
node_version: ['18']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
8 changes: 3 additions & 5 deletions packages/f-my/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ export function createCanvasAdapter(canvasContext: any) {
function bindDrawRunnable(fn: any, canvasContext: IMiniProgramCanvasContext_v1, addCallIdAction: () => void) {
return function (this: any, ...args: unknown[]) {
try {
fn.apply(this, arguments);
} catch(ex) {debugger
throw ex;
fn.apply(this, args);
} finally {
canvasContext.draw(true);
addCallIdAction();
Expand Down Expand Up @@ -317,11 +315,11 @@ class SimulatedCanvasContext {
public addCallIdActions(): void {
const { linearGradient, radialGradient } = this._callIdCache;
this._enableCacheCallId = false;
for (let item of linearGradient ) {
for (const item of linearGradient ) {
const gradient = this.ctx.createLinearGradient(0, 0, 0, 0);
Object.assign(gradient, item);
}
for (let item of radialGradient ) {
for (const item of radialGradient ) {
const gradient = this.ctx.createRadialGradient(0, 0, 0, 0, 0, 0);
Object.assign(gradient, item);
}
Expand Down
36 changes: 14 additions & 22 deletions packages/f-my/src/web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ Component({
.select(`#${id}`)
.boundingClientRect()
.exec((res) => {

if (!res[0]) {
return;
}
Expand All @@ -105,29 +104,22 @@ Component({
height: height * pixelRatio,
},
() => {
const {
element: canvas,
context
} = createCanvasAdapter(my.createCanvasContext(id));
try {
const fCanvas = this.createCanvas({
width,
height,
pixelRatio,
context,
createImage: canvas.createImage.bind(canvas),
requestAnimationFrame: canvas.requestAnimationFrame.bind(canvas),
cancelAnimationFrame: canvas.cancelAnimationFrame.bind(canvas),
});
fCanvas.render().catch((error) => {debugger
this.catchError(error);
});
} catch(ex) {
debugger
}
const { element: canvas, context } = createCanvasAdapter(my.createCanvasContext(id));
const fCanvas = this.createCanvas({
width,
height,
pixelRatio,
context,
createImage: canvas.createImage.bind(canvas),
requestAnimationFrame: canvas.requestAnimationFrame.bind(canvas),
cancelAnimationFrame: canvas.cancelAnimationFrame.bind(canvas),
});
fCanvas.render().catch((error) => {
this.catchError(error);
});
},
);
});
});
},

catchError(error) {
Expand Down

0 comments on commit 2c47995

Please sign in to comment.