Reputation: 1321
I used below code to clip area of canvas using fabric.js plugin
//set it as a canvas fix parent element
var shape = canvas.item(0);
canvas.remove(shape);
canvas.clipTo = function(ctx) {
shape.render(ctx);
};
canvas.renderAll();
But if I drag element outside of clipped area, controls get invisible. Need that controls to be visible throughout the canvas even if we drag element outside.
Upvotes: 1
Views: 1378
Reputation: 56
Just use canvas.controlsAboveOverlay = true;
after the clipTo-function. It works not only with overlay-images but also with clipped objects.
Upvotes: 4