update:lime-painter 从 1.9.5 升级到1.9.6.6

pull/147/head
YunaiV 2025-04-29 20:38:14 +08:00
parent 82aada5ecd
commit 9582d5944e
10 changed files with 248 additions and 259 deletions

View File

@ -1,3 +1,5 @@
## 1.9.6.62024-09-25
- fix: 修复background-position无效的问题
## 1.9.6.52024-04-14 ## 1.9.6.52024-04-14
- fix: 修复`nvue`无法生图的问题 - fix: 修复`nvue`无法生图的问题
## 1.9.6.42024-03-10 ## 1.9.6.42024-03-10

View File

@ -60,7 +60,7 @@
} }
}, },
dpr() { dpr() {
return this.pixelRatio || uni.getWindowInfo().pixelRatio; return this.pixelRatio || uni.getSystemInfoSync().pixelRatio;
}, },
boardWidth() { boardWidth() {
const {width = 0} = (this.elements && this.elements.css) || this.elements || this const {width = 0} = (this.elements && this.elements.css) || this.elements || this
@ -168,7 +168,7 @@
}, },
runTask(){ runTask(){
while(this.tasks.length){ while(this.tasks.length){
const task = this.tasks.shift() const task = this.tasks.shift()
this.canvasToTempFilePath(task) this.canvasToTempFilePath(task)
} }
}, },
@ -199,7 +199,7 @@
// #endif // #endif
await this.getSize(args) await this.getSize(args)
const ctx = await this.getContext(); const ctx = await this.getContext();
let { let {
use2dCanvas, use2dCanvas,
boardWidth, boardWidth,
@ -243,7 +243,7 @@
} }
} }
this.painter = new Painter(param) this.painter = new Painter(param)
} }
try{ try{
// vue3 data // vue3 data
const { width, height } = await this.painter.source(JSON.parse(JSON.stringify(args))) const { width, height } = await this.painter.source(JSON.parse(JSON.stringify(args)))
@ -278,7 +278,7 @@
}catch(e){ }catch(e){
//TODO handle the exception //TODO handle the exception
} }
}, },
canvasDraw(flag = false) { canvasDraw(flag = false) {
return new Promise((resolve, reject) => this.ctx.draw(flag, () => setTimeout(() => resolve(), this return new Promise((resolve, reject) => this.ctx.draw(flag, () => setTimeout(() => resolve(), this
@ -308,7 +308,7 @@
this.use2dCanvas = false; this.use2dCanvas = false;
this.canvas = res; this.canvas = res;
} }
// measureText mock // measureText mock
if (!ctx.measureText) { if (!ctx.measureText) {
function strLen(str) { function strLen(str) {
@ -334,7 +334,7 @@
}; };
} }
} }
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
ctx.scale(dpr, dpr); ctx.scale(dpr, dpr);
// #endif // #endif
@ -384,7 +384,7 @@
this.$emit('fail', e) this.$emit('fail', e)
} }
} }
let { top: y = 0, left: x = 0, width, height } = this.boundary || this; let { top: y = 0, left: x = 0, width, height } = this.boundary || this;
// let destWidth = width * dpr; // let destWidth = width * dpr;
// let destHeight = height * dpr; // let destHeight = height * dpr;
@ -392,7 +392,7 @@
// width = destWidth; // width = destWidth;
// height = destHeight; // height = destHeight;
// #endif // #endif
const copyArgs = Object.assign({ const copyArgs = Object.assign({
// x, // x,
// y, // y,

View File

@ -6,13 +6,16 @@ import {
networkReg networkReg
} from './utils'; } from './utils';
const dom = weex.requireModule('dom') const dom = weex.requireModule('dom')
import {
version
} from '../../package.json'
export default { export default {
data() { data() {
return { return {
tempFilePath: [], tempFilePath: [],
isInitFile: false, isInitFile: false,
osName: uni.getDeviceInfo().osName osName: uni.getSystemInfoSync().osName
} }
}, },
methods: { methods: {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,8 +3,7 @@ export const isBase64 = (path) => /^data:image\/(\w+);base64/.test(path);
export function sleep(delay) { export function sleep(delay) {
return new Promise(resolve => setTimeout(resolve, delay)) return new Promise(resolve => setTimeout(resolve, delay))
} }
let platform = uni.getDeviceInfo().platform let {platform, SDKVersion} = uni.getSystemInfoSync()
let SDKVersion = uni.getSystemInfoSync().SDKVersion
export const isPC = /windows|mac/.test(platform) export const isPC = /windows|mac/.test(platform)
// 缓存图片 // 缓存图片
let cache = {} let cache = {}
@ -317,7 +316,7 @@ export function getImageInfo(path, useCORS) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// console.log('getImageInfo', +new Date() - time) // console.log('getImageInfo', +new Date() - time)
// ios 比较严格 可能需要设置跨域 // ios 比较严格 可能需要设置跨域
if(uni.getDeviceInfo().osName === 'ios' && useCORS) { if(uni.getSystemInfoSync().osName == 'ios' && useCORS) {
pathToBase64(image.path).then(base64 => { pathToBase64(image.path).then(base64 => {
image.path = base64 image.path = base64
cache[path] = image cache[path] = image

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"id": "lime-painter", "id": "lime-painter",
"displayName": "海报画板", "displayName": "海报画板",
"version": "1.9.6.5", "version": "1.9.6.6",
"description": "一款canvas海报组件更优雅的海报生成方案有限的支持富文本", "description": "一款canvas海报组件更优雅的海报生成方案有限的支持富文本",
"keywords": [ "keywords": [
"海报", "海报",

View File

@ -1,9 +1,7 @@
# Painter 画板 测试版 # Painter 画板 测试版
> uniapp 海报画板,更优雅的海报生成方案 > uniapp 海报画板,更优雅的海报生成方案
> [查看更多 站点 1](https://limeui.qcoon.cn/#/painter) > [查看更多](https://limeui.qcoon.cn/#/painter)
> [查看更多 站点 2](http://liangei.gitee.io/limeui/#/painter)
> Q 群1169785031
## 平台兼容 ## 平台兼容