Skip to content

Commit

Permalink
refactor: Update ColorPicker codes
Browse files Browse the repository at this point in the history
  • Loading branch information
myxvisual committed Jul 1, 2017
1 parent 5a53fc9 commit 5811525
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ export class ColorPicker extends React.Component<ColorPickerProps, ColorPickerSt
const { v } = this.state;
const clientReact = this.canvas.getBoundingClientRect();
const colorPickerBoardSize = size * 0.8125 / 2;
const { clientX } = isTouchEvent ? (e as React.TouchEvent<HTMLCanvasElement>).changedTouches[0] : (e as React.MouseEvent<HTMLCanvasElement>);
const { clientY } = isTouchEvent ? (e as React.TouchEvent<HTMLCanvasElement>).changedTouches[0] : (e as React.MouseEvent<HTMLCanvasElement>);
const { clientX, clientY } = isTouchEvent ? (e as React.TouchEvent<HTMLCanvasElement>).changedTouches[0] : (e as React.MouseEvent<HTMLCanvasElement>);
const x = clientX - clientReact.left - colorPickerBoardSize;
const y = clientReact.top - clientY + colorPickerBoardSize;
const r = Math.sqrt(x * x + y * y);
Expand Down

0 comments on commit 5811525

Please sign in to comment.