fixed pixel ratio issue with createHitRegion

This commit is contained in:
Eric Rowell
2013-11-02 23:48:39 -07:00
parent 65166d7ddd
commit 224436aa18
4 changed files with 10 additions and 13 deletions

View File

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

View File

@@ -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(),