同步印花的缩放偏移显示
This commit is contained in:
@@ -69,6 +69,10 @@ export async function restoreFabricObject(serializedObject, canvas) {
|
||||
*/
|
||||
export function getObjectAlphaToCanvas(object, revData, diff = 30, rgba = { r: 255, g: 255, b: 255, a: 255 }) {
|
||||
const image = object.getElement();
|
||||
if (image.nodeName !== "IMG" && image.nodeName !== "CANVAS") {
|
||||
console.warn("对象不是图片");
|
||||
return null;
|
||||
}
|
||||
const { width, height } = image;
|
||||
if (!width || !height) {
|
||||
console.warn("对象没有元素");
|
||||
|
||||
Reference in New Issue
Block a user