You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer-ui/paint

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer-ui/paint - npm Package Compare versions

Comparing version
1.9.0
to
1.9.1
+5
-5
package.json
{
"name": "@leafer-ui/paint",
"version": "1.9.0",
"version": "1.9.1",
"description": "@leafer-ui/paint",

@@ -25,9 +25,9 @@ "author": "Chao (Leafer) Wan",

"dependencies": {
"@leafer/core": "1.9.0",
"@leafer-ui/draw": "1.9.0"
"@leafer/core": "1.9.1",
"@leafer-ui/draw": "1.9.1"
},
"devDependencies": {
"@leafer/interface": "1.9.0",
"@leafer-ui/interface": "1.9.0"
"@leafer/interface": "1.9.1",
"@leafer-ui/interface": "1.9.1"
}
}
import { IBoundsData, ILeaferCanvas, IRenderOptions, IMatrix } from '@leafer/interface'
import { BoundsHelper, Matrix } from '@leafer/core'
import { BoundsHelper, Matrix, Platform } from '@leafer/core'

@@ -11,11 +11,9 @@ import { IUI, ICachedShape } from '@leafer-ui/interface'

const canvas = current.getSameCanvas()
const nowWorld = ui.__nowWorld
const nowWorld = ui.__nowWorld, currentBounds = current.bounds
let bounds: IBoundsData, matrix: IMatrix, fitMatrix: IMatrix, shapeBounds: IBoundsData, worldCanvas: ILeaferCanvas
let { scaleX, scaleY } = nowWorld
if (scaleX < 0) scaleX = -scaleX
if (scaleY < 0) scaleY = -scaleY
let { scaleX, scaleY } = ui.getRenderScaleData(true)
if (current.bounds.includes(nowWorld)) {
if (currentBounds.includes(nowWorld)) {

@@ -28,4 +26,13 @@ worldCanvas = canvas

const { renderShapeSpread: spread } = ui.__layout
const worldClipBounds = getIntersectData(spread ? getSpread(current.bounds, scaleX === scaleY ? spread * scaleX : [spread * scaleY, spread * scaleX]) : current.bounds, nowWorld)
fitMatrix = current.bounds.getFitMatrix(worldClipBounds)
let worldClipBounds: IBoundsData // 作为绘制阴影的裁剪形状
if (Platform.fullImageShadow) { // fix: iOS Safari 18.5 以上, 只裁剪部分区域渲染阴影会有问题
worldClipBounds = nowWorld
} else {
const spreadBounds = spread ? getSpread(currentBounds, scaleX === scaleY ? spread * scaleX : [spread * scaleY, spread * scaleX]) : currentBounds
worldClipBounds = getIntersectData(spreadBounds, nowWorld)
}
fitMatrix = currentBounds.getFitMatrix(worldClipBounds)
let { a: fitScaleX, d: fitScaleY } = fitMatrix

@@ -32,0 +39,0 @@