Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 修复ci #315

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading