KineticJS
KineticJS copied to clipboard
Click event not firing on right side of Rect.
The following does not seem to work when I click near right edge of the green Rect.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="./_js/library/jquery-1.10.2.js"></script>
<script src="./_js/library/kinetic-v5.0.0.js"></script>
<script type='text/javascript'>
var OnLoad = function(){
var nW = +jQuery('#divContainer').width( );
var nH = +jQuery('#divContainer').height();
var kstage = new Kinetic.Stage( {'container':'divContainer' ,'width':nW ,'height':nH} );
var klayer = new Kinetic.Layer();
var krect = new Kinetic.Rect( {'fill':'#DDFFDD' ,'x':0 ,'y':0 ,'width':790 ,'height':100} );
krect.on( 'click' ,function(a){ console.log( kstage.getPointerPosition().x ); } );
klayer.add( krect );
kstage.add( klayer );
}
jQuery(window)['load']( OnLoad );
</script>
</head>
<body>
<div id="divContainer" style="width:800px;height:200px;border:1px solid #FF0000"></div>
</body>
</html>
Seems to work in FireFox and IE10.
I re-installed Chrome and it now appears to be working. I guess this can be marked as not-a-problem.