mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-05-14 00:33:09 +00:00
fix for bluriness (#3721)
This commit is contained in:
parent
7acfec2511
commit
676ae10618
2 changed files with 7 additions and 7 deletions
|
|
@ -872,8 +872,8 @@
|
|||
width = dim.x * zoomX,
|
||||
height = dim.y * zoomY;
|
||||
return {
|
||||
width: Math.ceil(width) + 2,
|
||||
height: Math.ceil(height) + 2,
|
||||
width: width + 2,
|
||||
height: height + 2,
|
||||
zoomX: zoomX,
|
||||
zoomY: zoomY
|
||||
};
|
||||
|
|
@ -897,8 +897,8 @@
|
|||
zoomX = dims.zoomX, zoomY = dims.zoomY;
|
||||
|
||||
if (width !== this.cacheWidth || height !== this.cacheHeight) {
|
||||
this._cacheCanvas.width = width;
|
||||
this._cacheCanvas.height = height;
|
||||
this._cacheCanvas.width = Math.ceil(width);
|
||||
this._cacheCanvas.height = Math.ceil(height);
|
||||
this._cacheContext.translate(width / 2, height / 2);
|
||||
this._cacheContext.scale(zoomX, zoomY);
|
||||
this.cacheWidth = width;
|
||||
|
|
|
|||
|
|
@ -403,9 +403,9 @@
|
|||
*/
|
||||
_getCacheCanvasDimensions: function() {
|
||||
var dim = this.callSuper('_getCacheCanvasDimensions');
|
||||
var fontSize = Math.ceil(this.fontSize) * 2;
|
||||
dim.width += fontSize;
|
||||
dim.height += fontSize;
|
||||
var fontSize = this.fontSize * 2;
|
||||
dim.width += fontSize * dim.zoomX;
|
||||
dim.height += fontSize * dim.zoomY;
|
||||
return dim;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue