mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 19:07:59 +08:00
Merge pull request #786 from kzhdev/fix-setPixelRatio
fixed an issue where setPixelRatio changed canvas to wrong size
This commit is contained in:
@@ -86,8 +86,10 @@
|
|||||||
* ratio for special situations, or, if you don't want the pixel ratio to be taken into account, you can set it to 1.
|
* ratio for special situations, or, if you don't want the pixel ratio to be taken into account, you can set it to 1.
|
||||||
*/
|
*/
|
||||||
setPixelRatio: function(pixelRatio) {
|
setPixelRatio: function(pixelRatio) {
|
||||||
|
var width = this.getWidth() / this.pixelRatio,
|
||||||
|
height = this.getHeight() / this.pixelRatio;
|
||||||
this.pixelRatio = pixelRatio;
|
this.pixelRatio = pixelRatio;
|
||||||
this.setSize(this.getWidth(), this.getHeight());
|
this.setSize(width, height);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* set width
|
* set width
|
||||||
|
Reference in New Issue
Block a user