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

fix(canvas-h5): canvas 同步 API canvasToTempFilePath 节点获取问题 #7957

Merged
merged 5 commits into from
Dec 12, 2020
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
4 changes: 2 additions & 2 deletions packages/taro-h5/src/api/canvas/canvasToTempFilePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { findDOM } from '../utils/index'
* @param {Param} object 参数
* @todo 暂未支持尺寸相关功能
*/
const canvasToTempFilePath = ({ canvasId, fileType, quality, success, fail, complete }) => {
const canvasToTempFilePath = ({ canvasId, fileType, quality, success, fail, complete }, inst) => {
/** @type {HTMLCanvasElement} */
const canvas = findDOM().querySelector(`[canvasId=${canvasId}]`)
const canvas = findDOM(inst).querySelector(`[canvas-id=${canvasId}]`)

try {
// /** @type {CanvasRenderingContext2D} */
Expand Down
6 changes: 3 additions & 3 deletions packages/taro-h5/src/api/canvas/createCanvasContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ const createCanvasContext = (canvasId, inst) => {
['clearRect'],
['clip'],
['closePath'],
['createCircularGradient'],
['createLinearGradient'],
['createPattern'],
['createCircularGradient', true],
['createLinearGradient', true],
['createPattern', true],
['drawImage'],
['fill'],
['fillRect'],
Expand Down