grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Customize image resizing

Open sakshigarg9 opened this issue 7 years ago • 4 comments

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?

sakshigarg9 avatar Feb 19 '19 06:02 sakshigarg9

You can use this options for the resizable property of components

artf avatar Feb 22 '19 13:02 artf

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

sakshigarg9 avatar Feb 26 '19 07:02 sakshigarg9

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
			}
		}
	}
})

artf avatar Mar 03 '19 14:03 artf

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.

lock[bot] avatar Mar 10 '20 20:03 lock[bot]