refactor(resize-control): handle min max width + aspect ratio

This commit is contained in:
moklick
2023-03-07 17:54:39 +01:00
parent 2a352a67de
commit dcc2ce4baa
2 changed files with 31 additions and 2 deletions
@@ -45,7 +45,14 @@ const initialNodes: Node[] = [
{
id: '1b',
type: 'defaultResizer',
data: { label: 'default resizer with initial size and aspect ratio', keepAspectRatio: true },
data: {
label: 'default resizer with initial size and aspect ratio',
keepAspectRatio: true,
minWidth: 100,
minHeight: 60,
maxWidth: 400,
maxHeight: 400,
},
position: { x: 250, y: 0 },
style: {
width: 174,
@@ -82,7 +89,13 @@ const initialNodes: Node[] = [
{
id: '4',
type: 'horizontalResizer',
data: { label: 'horizontal resizer with aspect ratio', keepAspectRatio: true },
data: {
label: 'horizontal resizer with aspect ratio',
keepAspectRatio: true,
minHeight: 20,
maxHeight: 80,
maxWidth: 300,
},
position: { x: 250, y: 300 },
style: { ...nodeStyle },
},