Skip to content

Instantly share code, notes, and snippets.

@dbismut
Last active April 9, 2018 07:54
Show Gist options
  • Select an option

  • Save dbismut/9c44266186e05be605264d8278e4f7b6 to your computer and use it in GitHub Desktop.

Select an option

Save dbismut/9c44266186e05be605264d8278e4f7b6 to your computer and use it in GitHub Desktop.
Part 2 - calculating the style of the preview node
getPreviewStyleAndPosition = () => {
const { top, width, height } = this.preview.getBoundingClientRect();
return {
top,
width,
height,
borderRadius: 16
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment