GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

Customize image resizing #1809

Closed sakshigarg9 closed 5 years ago

sakshigarg9 commented 5 years ago

If i want to limit resizing an image to only specific dimensions, how can i do that? Also is it possible to enable resizing only from the bottom right corner and disable from the other corners and points?

artf commented 5 years ago

You can use this options for the resizable property of components

sakshigarg9 commented 5 years ago

How can I update these properties if I'm using the grapesjs-preset-webpage?

artf commented 5 years ago

How can I update these properties if I'm using the grapesjs-preset-webpage?

You can always update a component type (but do it as a plugin)

editor.DomComponents.addType('image', {
    model: {
        defaults: {
            resizable: {
                  tl: 0, // Top left
                  tc: 0, // Top center
                  tr: 0, // Top right
                  cl: 0, // Center left
                  bl: 0, // Bottom left
            }
        }
    }
})
lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.