wechat-miniprogram / wechat-miniprogram/api-typings

Canvas.drawImage的API和实际不符

Open Beginner friendly
#171 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
803
Forks
117
Avg merge
24m
Merged PRs (30d)
1

Description

https://github.com/wechat-miniprogram/api-typings/blob/master/types/wx/lib.wx.api.d.ts#L7358
中api写的第一个参数ImageSourcestring
实际为 Image 对象,必须先用

const img = canvas.createImage();

创建Image对象后,再使用将此img对象进行绘制

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the ImageSource declaration at types/wx/lib.wx.api.d.ts line 7358. Compare the declared first parameter of Canvas.drawImage with the Image object created by canvas.createImage(). Done means the type definition reflects the reported runtime API.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.