I'm using the code from mouseenter example, but instead of view.center
place the circle at (50;50)
When the cursor is above the circle, the circle should become red. But it works only with upper left part of it.
Tested in Firefox, Windows 8
$(document).ready(() =>
{
var canvas = document.getElementById("mainCanvas")
paper.setup(canvas)
console.log("creating circle")
var path = new paper.Path.Circle({
center: new paper.Point(50,50),
radius: 25,
fillColor: 'black'
});
console.log("created circle")
// When the mouse enters the item, set its fill color to red:
path.on('mouseenter', function () {
this.fillColor = 'red';
});
// When the mouse leaves the item, set its fill color to black:
path.on('mouseleave', function () {
this.fillColor = 'black';
});
})
canvas {
border-style:double
}
<script src="https://code.jquery.com/jquery-2.1.3.js"> </script>
<script src = https://cdnjs.cloudflare.com/ajax/libs/paper.js/0.10.3/paper-full.js></script>
<canvas id = "mainCanvas" resize></canvas>
<div>!!</div>