Jitendra Pawar
Jitendra Pawar

Reputation: 1321

can not view selector controls outside the clipping area in canvas (fabric.js)

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

Answers (1)

zaduk
zaduk

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

Related Questions