@meta2d/core
Advanced tools
Comparing version 1.0.60 to 1.0.61
{ | ||
"name": "@meta2d/core", | ||
"version": "1.0.60", | ||
"version": "1.0.61", | ||
"description": "@meta2d/core: Powerful, Beautiful, Simple, Open - Web-Based 2D At Its Best .", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,3 @@ import { Meta2dStore } from '../store'; | ||
offscreen: any; | ||
domOffscreen: any; | ||
private magnifierSize; | ||
@@ -19,3 +20,4 @@ magnifier: boolean; | ||
private renderMagnifier; | ||
updateDomOffscreen(): void; | ||
render(): void; | ||
} |
@@ -9,2 +9,3 @@ import { createOffscreen } from './offscreen'; | ||
offscreen = createOffscreen(); | ||
domOffscreen = createOffscreen(); | ||
magnifierSize = 300; | ||
@@ -36,2 +37,6 @@ magnifier; | ||
this.offscreen.getContext('2d').textBaseline = 'middle'; | ||
this.domOffscreen.width = w; | ||
this.domOffscreen.height = h; | ||
this.domOffscreen.getContext('2d').scale(this.store.dpiRatio, this.store.dpiRatio); | ||
this.domOffscreen.getContext('2d').textBaseline = 'middle'; | ||
this.magnifierScreen.width = this.magnifierSize + 5; | ||
@@ -76,2 +81,3 @@ this.magnifierScreen.height = this.magnifierSize + 5; | ||
this.parentCanvas.canvasImage.animateOffsScreen, | ||
this.domOffscreen //dom元素的绘制层 | ||
]; | ||
@@ -95,2 +101,17 @@ drawOffscreens.forEach((offscreen) => { | ||
} | ||
updateDomOffscreen() { | ||
const domCtx = this.domOffscreen.getContext('2d'); | ||
domCtx.clearRect(0, 0, this.domOffscreen.width, this.domOffscreen.height); | ||
for (const pen of this.store.data.pens) { | ||
if (pen.externElement || pen.name === 'gif') { | ||
if (pen.calculative.img) { | ||
domCtx.save(); | ||
domCtx.translate(this.store.data.x, this.store.data.y); | ||
const { x, y, width, height } = pen.calculative.worldRect; | ||
domCtx.drawImage(pen.calculative.img, x, y, width, height); | ||
domCtx.restore(); | ||
} | ||
} | ||
} | ||
} | ||
render() { | ||
@@ -97,0 +118,0 @@ this.offscreen |
@@ -30,2 +30,3 @@ import { EventType, Handler, WildcardHandler } from 'mitt'; | ||
url?: string; | ||
method?: string; | ||
}) => boolean | string; | ||
@@ -220,4 +221,7 @@ events: Record<number, (pen: Pen, e: Event) => void>; | ||
updateTimerList: any[]; | ||
sqlTimerList: any[]; | ||
connectNetwork(): void; | ||
connectNetWebSocket(net: Network): void; | ||
getIotToken(devices: any): Promise<any>; | ||
doSqlCode(type: string, dbid: string, sql: string): Promise<void>; | ||
randomString(e: number): string; | ||
@@ -239,2 +243,3 @@ mockValue(data: any): any; | ||
url?: string; | ||
method?: string; | ||
}): void; | ||
@@ -266,3 +271,3 @@ setDatas(datas: { | ||
private doEvent; | ||
doMessageEvent(eventName: string): void; | ||
doMessageEvent(eventName: string, data?: any): void; | ||
doDataEvent: (datas: { | ||
@@ -269,0 +274,0 @@ dataId?: string; |
@@ -141,6 +141,6 @@ export class Dialog { | ||
if (rect) { | ||
this.dialog.style.top = rect.y ? (rect.y + 'px') : '15vh'; | ||
this.dialog.style.left = rect.x ? (rect.x + 'px') : '10%'; | ||
this.dialog.style.width = rect.width ? (rect.width + 'px') : '80%'; | ||
this.dialog.style.height = rect.height ? (rect.height + 'px') : '420px'; | ||
this.dialog.style.top = rect.y ? (rect.y + 'px') : '15vh'; | ||
this.dialog.style.left = rect.x ? (rect.x + 'px') : `calc( 50% - ${rect.width ? rect.width / 2 + 'px' : '40%'} )`; | ||
} | ||
@@ -147,0 +147,0 @@ this.box.style.display = 'block'; |
@@ -24,2 +24,7 @@ import { Meta2d } from '../core'; | ||
callback?: string; | ||
list?: { | ||
params?: string; | ||
value?: EventValue; | ||
}[]; | ||
timeout?: number; | ||
} | ||
@@ -26,0 +31,0 @@ export declare enum EventAction { |
@@ -200,2 +200,3 @@ import { Point } from '../point'; | ||
lineAnimateType?: LineAnimateType; | ||
animateName?: string; | ||
frames?: Pen[]; | ||
@@ -209,2 +210,6 @@ animateList?: Pen[][]; | ||
dropdownList?: Dropdown[]; | ||
dropdownBackground?: string; | ||
dropdownColor?: string; | ||
dropdownHoverColor?: string; | ||
dropdownHoverBackground?: string; | ||
events?: Event[]; | ||
@@ -211,0 +216,0 @@ iframe?: string; |
@@ -108,3 +108,3 @@ import { Emitter } from 'mitt'; | ||
name?: string; | ||
protocol?: 'mqtt' | 'websocket' | 'http'; | ||
protocol?: 'mqtt' | 'websocket' | 'http' | 'iot' | 'sql'; | ||
type?: string; | ||
@@ -127,2 +127,5 @@ url?: string; | ||
index?: number; | ||
devices?: any[]; | ||
dbId?: string; | ||
sql?: string; | ||
} | ||
@@ -129,0 +132,0 @@ export interface HttpOptions { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1840680
25936
18