mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
fixed pixel ratio issue with createHitRegion
This commit is contained in:
@@ -577,12 +577,7 @@
|
||||
canvas.height = arg.height;
|
||||
_context = canvas.getContext(CONTEXT_2D);
|
||||
_context.putImageData(arg, 0, 0);
|
||||
dataUrl = canvas.toDataURL();
|
||||
imageObj = new Image();
|
||||
imageObj.onload = function() {
|
||||
callback(imageObj);
|
||||
};
|
||||
imageObj.src = dataUrl;
|
||||
this._getImage(canvas.toDataURL(), callback);
|
||||
}
|
||||
else {
|
||||
callback(null);
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
imageHitRegion = this.imageHitRegion;
|
||||
|
||||
if(imageHitRegion) {
|
||||
context.drawImage(imageHitRegion, 0, 0, width, height);
|
||||
context.drawImage(imageHitRegion, 0, 0);
|
||||
context.beginPath();
|
||||
context.rect(0, 0, width, height);
|
||||
context.closePath();
|
||||
@@ -182,7 +182,8 @@
|
||||
height = this.getHeight(),
|
||||
canvas = new Kinetic.SceneCanvas({
|
||||
width: width,
|
||||
height: height
|
||||
height: height,
|
||||
pixelRatio: 1
|
||||
}),
|
||||
_context = canvas.getContext()._context,
|
||||
image = this.getImage(),
|
||||
|
||||
Reference in New Issue
Block a user