polotno-project / polotno-board

Roadmap and bug-tracker for the Polotno project.
https://polotno.dev/
9 stars 1 forks source link

A "click-through" top-level element #32

Closed iamsterdam800 closed 2 years ago

iamsterdam800 commented 2 years ago

My design template needs to have a top-level element (e.g. a frame with my logo), that I don't want the user to select or edit.

It should be fixed as a top-level element. So when user adds elements to canvas, the frame should remain on top (covering user's elements). It should not be possible to re-order elements (e.g. with Up, To forward) in a way that they appear on top of the frame.

The frame element should not respond to mouse events. When the user clicks to select, their click should "go through" the frame element and select their element, not the frame.

So something like the "background" image, but on the fore side :)

lavrton commented 2 years ago

That is a good feature. I will schedule it for the next release.

lavrton commented 2 years ago

Released with polotno@0.33.0. element.set({ selectable: false }). or store.setRole('admin') to change this property from UI.

iamsterdam800 commented 2 years ago

Hi Anton, thanks for super-quick implementation! As far as I understood for my case, I'd need to set these two element attributes, correct?

          "selectable" : false,
          "alwaysOnTop" : true,

It's even better, that these two are seperately controlled!

iamsterdam800 commented 2 years ago

store.setRole('admin') doesn't seem to have any effect.. I do not see any extra UI controls, when I add this line. It's not that I need it actually.. just asking :)

lavrton commented 2 years ago

As far as I understood for my case, I'd need to set these two element attributes, correct?

Yes.

I do not see any extra UI controls

Right now, it is not very noticeable. Probably I will change it later.

Screen Shot 2021-09-30 at 9 33 11