From 58d5286b607f297e12a2c6552fb1ee3b87320293 Mon Sep 17 00:00:00 2001 From: Ray Schamp <ray@scratch.mit.edu> Date: Fri, 13 Jan 2017 12:52:24 -0500 Subject: [PATCH] Calculate rotation centers from backdrop library The `info` property seems to refer to the image size, not the rotation center in the backdrop library. So if it exists, halve it to find the center. Towards #18 --- src/containers/backdrop-library.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/containers/backdrop-library.jsx b/src/containers/backdrop-library.jsx index b3aaaa290..7291663e7 100644 --- a/src/containers/backdrop-library.jsx +++ b/src/containers/backdrop-library.jsx @@ -17,8 +17,8 @@ class BackdropLibrary extends React.Component { const vmBackdrop = { skin: `https://cdn.assets.scratch.mit.edu/internalapi/asset/${item.md5}/get/`, name: item.name, - rotationCenterX: item.info[0], - rotationCenterY: item.info[1] + rotationCenterX: item.info[0] && item.info[0] / 2, + rotationCenterY: item.info[1] && item.info[1] / 2 }; if (item.info.length > 2) { vmBackdrop.bitmapResolution = item.info[2]; -- GitLab