mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
fixed an issue where setPixelRatio changed canvas to wrong size
This commit is contained in:
parent
774f50007c
commit
ed03702cd5
@ -79,8 +79,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.
|
||||
*/
|
||||
setPixelRatio: function(pixelRatio) {
|
||||
var width = this.getWidth() / this.pixelRatio,
|
||||
height = this.getHeight() / this.pixelRatio;
|
||||
this.pixelRatio = pixelRatio;
|
||||
this.setSize(this.getWidth(), this.getHeight());
|
||||
this.setSize(width, height);
|
||||
},
|
||||
/**
|
||||
* set width
|
||||
|
Loading…
Reference in New Issue
Block a user