Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,15 @@ export class Rnd extends React.PureComponent<Props, State> {
const parentLeft = parentRect.left;
const parentTop = parentRect.top;
const left = (boundaryLeft - parentLeft) / scale;
const top = boundaryTop - parentTop;
const top = boundaryTop - parentTop / scale;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it needed to add paren?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,it should be const top = (boundaryTop - parentTop) / scale;

if (!this.resizable) return;
this.updateOffsetFromParent();
const offset = this.offsetFromParent;
this.setState({
bounds: {
top: top - offset.top,
top: top - offset.top / scale,
right: left + (boundary.offsetWidth - this.resizable.size.width) - offset.left / scale,
bottom: top + (boundary.offsetHeight - this.resizable.size.height) - offset.top,
bottom: top + (boundary.offsetHeight - this.resizable.size.height) - offset.top / scale,
left: left - offset.left / scale,
},
});
Expand Down