fabric.Image now renders image according to current width/height (not width/height of original image).

This commit is contained in:
kangax 2012-05-27 23:48:00 +04:00
parent 7030c3e582
commit af67423df9
4 changed files with 11 additions and 13 deletions

11
dist/all.js vendored
View file

@ -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

File diff suppressed because one or more lines are too long

BIN
dist/all.min.js.gz vendored

Binary file not shown.

View file

@ -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;
/**