mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-05 20:34:45 +00:00
introduce a parameter to choose behaviour of background and overlay (#3019)
* introduce a parameter to choose behaviour of background and overlay
This commit is contained in:
parent
d4e723e49d
commit
5a6b11ef50
1 changed files with 21 additions and 0 deletions
|
|
@ -147,6 +147,22 @@
|
|||
*/
|
||||
viewportTransform: [1, 0, 0, 1, 0, 0],
|
||||
|
||||
/**
|
||||
* if set to false background image is not affected by viewport transform
|
||||
* @since 1.6.3
|
||||
* @type Boolean
|
||||
* @default
|
||||
*/
|
||||
backgroundVpt: true,
|
||||
|
||||
/**
|
||||
* if set to false overlya image is not affected by viewport transform
|
||||
* @since 1.6.3
|
||||
* @type Boolean
|
||||
* @default
|
||||
*/
|
||||
overlayVpt: true,
|
||||
|
||||
/**
|
||||
* Callback; invoked right before object is about to be scaled/rotated
|
||||
*/
|
||||
|
|
@ -922,7 +938,12 @@
|
|||
}
|
||||
object = this[property + 'Image'];
|
||||
if (object) {
|
||||
if (this[property + 'Vpt']) {
|
||||
ctx.save();
|
||||
ctx.transform.apply(ctx, this.viewportTransform);
|
||||
}
|
||||
object.render(ctx);
|
||||
this[property + 'Vpt'] && ctx.restore();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue