leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

原生微信小程序用path实现画笔 在android正常 ios 少部分手机正常 大部分直接闪退

Open nws123045088 opened this issue 1 year ago • 4 comments

801bd896fb501e950381711d035a1b1

//1.画笔ios add闪退 let brush = null; let lastPoint = undefined; this.canvas.tree.on(DragEvent.START, (e) => { if (this.currentTab !== 4) { return; } lastPoint = undefined; brush = new Path({ zIndex: 99, windingRule: "nonzero", fill: this.brush_color || "rgb(7,193,96)", data: { radius: (this.brush_size || 10) / 2, }, }); this.canvas.tree.add(brush); });

//2.橡皮擦 ios add 画布内容直接不见了 let eraser = null; let lastPoint = undefined; this.canvas.tree.on(DragEvent.START, (e) => { if (this.currentTab !== 3) { return; } lastPoint = undefined; eraser = new Path({ zIndex: 99, windingRule: "nonzero", fill: "rgb(255,255,255,0)", eraser: "path", data: { radius: (this.eraser_size || 10) / 2, }, }); this.canvas.tree.add(eraser); });

nws123045088 avatar Sep 06 '24 06:09 nws123045088

收到,谢谢反馈~, path去掉windingRule属性试试,橡皮擦用'path'类型可以: eraser: 'path'

leaferjs avatar Sep 06 '24 06:09 leaferjs

第一个问题 path去掉windingRule属性可以了 第二个问题无效 我排查下

nws123045088 avatar Sep 07 '24 02:09 nws123045088

eraser = new Path({ zIndex: 99, fill: "rgb(255,255,255,1)", // eraser: "path", data: { radius: (this.eraser_size || 10) / 2, }, }); this.canvas.tree.add(eraser); 加了这个eraser: "path", 画布内容就全部没了

nws123045088 avatar Sep 07 '24 02:09 nws123045088

1caaff832503ae63e2b6254cda90689

nws123045088 avatar Sep 07 '24 04:09 nws123045088