mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-16 01:33:09 +00:00
fabric.Image now renders image according to current width/height (not width/height of original image).
This commit is contained in:
parent
7030c3e582
commit
af67423df9
4 changed files with 11 additions and 13 deletions
11
dist/all.js
vendored
11
dist/all.js
vendored
|
|
@ -11516,13 +11516,12 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
* @private
|
||||
*/
|
||||
_render: function(ctx) {
|
||||
var originalImgSize = this.getOriginalSize();
|
||||
ctx.drawImage(
|
||||
this.getElement(),
|
||||
- originalImgSize.width / 2,
|
||||
- originalImgSize.height / 2,
|
||||
originalImgSize.width,
|
||||
originalImgSize.height
|
||||
- this.width / 2,
|
||||
-this.height / 2,
|
||||
this.width,
|
||||
this.height
|
||||
);
|
||||
},
|
||||
|
||||
|
|
@ -11620,7 +11619,7 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, {
|
|||
* @type String
|
||||
*/
|
||||
fabric.Image.CSS_CANVAS = "canvas-img";
|
||||
|
||||
|
||||
fabric.Image.prototype.getSvgSrc = fabric.Image.prototype.getSrc;
|
||||
|
||||
/**
|
||||
|
|
|
|||
2
dist/all.min.js
vendored
2
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -266,13 +266,12 @@
|
|||
* @private
|
||||
*/
|
||||
_render: function(ctx) {
|
||||
var originalImgSize = this.getOriginalSize();
|
||||
ctx.drawImage(
|
||||
this.getElement(),
|
||||
- originalImgSize.width / 2,
|
||||
- originalImgSize.height / 2,
|
||||
originalImgSize.width,
|
||||
originalImgSize.height
|
||||
- this.width / 2,
|
||||
-this.height / 2,
|
||||
this.width,
|
||||
this.height
|
||||
);
|
||||
},
|
||||
|
||||
|
|
@ -370,7 +369,7 @@
|
|||
* @type String
|
||||
*/
|
||||
fabric.Image.CSS_CANVAS = "canvas-img";
|
||||
|
||||
|
||||
fabric.Image.prototype.getSvgSrc = fabric.Image.prototype.getSrc;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue