chore(resizer): cleanup
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
# @reactflow/node-resizer
|
||||
|
||||
## 1.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- cleanup
|
||||
|
||||
## 1.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix `minWidth` and `minHeight` so that it can be used dynamically
|
||||
|
||||
|
||||
## 1.0.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -7,4 +7,3 @@ A resizer component for React Flow that can be attached to a node.
|
||||
```sh
|
||||
npm install @reactflow/node-resizer
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@reactflow/node-resizer",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"description": "A helper component for resizing nodes.",
|
||||
"keywords": [
|
||||
"react",
|
||||
|
||||
@@ -87,12 +87,10 @@ function ResizeControl({
|
||||
} = startValues.current;
|
||||
|
||||
const { x: prevX, y: prevY, width: prevWidth, height: prevHeight } = prevValues.current;
|
||||
|
||||
const distX = Math.floor(enableX ? xSnapped - startX : 0);
|
||||
const distY = Math.floor(enableY ? ySnapped - startY : 0);
|
||||
const width = Math.max(startWidth + (invertX ? -distX : distX), minWidth);
|
||||
const height = Math.max(startHeight + (invertY ? -distY : distY), minHeight);
|
||||
|
||||
const isWidthChange = width !== prevWidth;
|
||||
const isHeightChange = height !== prevHeight;
|
||||
|
||||
@@ -131,6 +129,7 @@ function ResizeControl({
|
||||
height: height,
|
||||
},
|
||||
};
|
||||
|
||||
changes.push(dimensionChange);
|
||||
prevValues.current.width = width;
|
||||
prevValues.current.height = height;
|
||||
|
||||
Reference in New Issue
Block a user