Skip to content

Commit

Permalink
fix: index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb committed Nov 16, 2018
1 parent 2c60570 commit 6825ed9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -294,6 +294,10 @@ npm test

## Changelog

#### v4.10.0

- Add scale props #388

#### v4.9.3

- Fix auto having "px" appended #382
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Expand Up @@ -123,6 +123,7 @@ export interface ResizableProps extends React.HTMLAttributes<HTMLDivElement> {
handleWrapperStyle?: React.CSSProperties,
handleWrapperClass?: string,
handleComponent?: HandleComponent,
scale?: number
}

export default class Resizable extends React.Component<ResizableProps, ResizableState> {
Expand Down
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -120,7 +120,7 @@ export type ResizableProps = {
onResize?: ResizeCallback,
onResizeStop?: ResizeCallback,
defaultSize?: Size,
scale: number
scale?: number
};

type State = {
Expand Down Expand Up @@ -411,7 +411,8 @@ export default class Resizable extends React.Component<ResizableProps, State> {
const clientX = event instanceof MouseEvent ? event.clientX : event.touches[0].clientX;
const clientY = event instanceof MouseEvent ? event.clientY : event.touches[0].clientY;
const { direction, original, width, height } = this.state;
const { lockAspectRatio, lockAspectRatioExtraHeight, lockAspectRatioExtraWidth, scale } = this.props;
const { lockAspectRatio, lockAspectRatioExtraHeight, lockAspectRatioExtraWidth } = this.props;
const scale = this.props.scale || 1;
let { maxWidth, maxHeight, minWidth, minHeight } = this.props;

// TODO: refactor
Expand Down

0 comments on commit 6825ed9

Please sign in to comment.