@leafer/platform
Advanced tools
+4
-4
| { | ||
| "name": "@leafer/platform", | ||
| "version": "1.12.3", | ||
| "version": "1.12.4", | ||
| "description": "@leafer/platform", | ||
@@ -25,8 +25,8 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/data": "1.12.3", | ||
| "@leafer/debug": "1.12.3" | ||
| "@leafer/data": "1.12.4", | ||
| "@leafer/debug": "1.12.4" | ||
| }, | ||
| "devDependencies": { | ||
| "@leafer/interface": "1.12.3" | ||
| "@leafer/interface": "1.12.4" | ||
| } | ||
| } |
+7
-5
@@ -36,7 +36,9 @@ import { IPlatform, IObject, IBoundsData, ICanvasPattern, IMatrixData, ILeaferImagePatternPaint, ISizeData, ICanvasContext2D } from '@leafer/interface' | ||
| ctx.imageSmoothingEnabled = smooth === false ? false : true // 平滑绘制 | ||
| if (clip) { | ||
| const scaleX = width / clip.width, scaleY = height / clip.height | ||
| ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY) | ||
| ctx.drawImage(image, 0, 0, image.width, image.height) | ||
| } else ctx.drawImage(image, 0, 0, width, height) | ||
| if (image) { | ||
| if (clip) { | ||
| const scaleX = width / clip.width, scaleY = height / clip.height | ||
| ctx.setTransform(scaleX, 0, 0, scaleY, -clip.x * scaleX, -clip.y * scaleY) | ||
| ctx.drawImage(image, 0, 0, image.width, image.height) | ||
| } else ctx.drawImage(image, 0, 0, width, height) | ||
| } | ||
| return canvas | ||
@@ -43,0 +45,0 @@ }, |
7506
0.79%131
1.55%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated