Skip to content

Commit

Permalink
fix: make resizing options take effect (#3014)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Dec 7, 2022
1 parent 80898ad commit 604c024
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion examples/x6-example-features/src/pages/selection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default class Example extends React.Component {
strict: true,
showNodeSelectionBox: true,
selectCellOnMoved: false,
useCellGeometry: true,
filter(cell) {
return cell !== a
},
Expand Down
21 changes: 13 additions & 8 deletions packages/x6-plugin-transform/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,23 @@ export class Transform extends Basecoat<Transform.EventArgs> {
)

const options: TransformImpl.Options = {
resizable: resizing.enabled,
resizable: !!resizing.enabled,
minWidth: resizing.minWidth || 0,
maxWidth: resizing.maxWidth || Number.MAX_SAFE_INTEGER,
minHeight: resizing.minHeight || 0,
maxHeight: resizing.maxHeight || Number.MAX_SAFE_INTEGER,
orthogonalResizing: resizing.orthogonal || true,
restrictedResizing: resizing.restrict || false,
autoScrollOnResizing: resizing.autoScroll || true,
preserveAspectRatio: resizing.preserveAspectRatio || false,
allowReverse: resizing.allowReverse || true,

rotatable: rotating.enabled || false,
orthogonalResizing:
typeof resizing.orthogonal === 'boolean' ? resizing.orthogonal : true,
restrictedResizing: !!resizing.restrict,
autoScrollOnResizing:
typeof resizing.autoScroll === 'boolean' ? resizing.autoScroll : true,
preserveAspectRatio: !!resizing.preserveAspectRatio,
allowReverse:
typeof resizing.allowReverse === 'boolean'
? resizing.allowReverse
: true,

rotatable: !!rotating.enabled,
rotateGrid: rotating.grid || 15,
}

Expand Down

0 comments on commit 604c024

Please sign in to comment.