Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Fixed position bug after exporting
Browse files Browse the repository at this point in the history
Updated based on this bug report #27
  • Loading branch information
niittymaa authored May 24, 2017
1 parent f6baf93 commit d66fb90
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions AnimateMate.sketchplugin/Contents/Sketch/library/Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,12 @@ Animation.prototype.getOriginalValues = function (layer) {
var layer = layer || this.layer;
var parentGroupValues = this.getParentValues();
var returnObj = {};

returnObj.x = Math.round((layer.frame().x() + parentGroupValues.x) * 100) / 100;
returnObj.y = Math.round((layer.frame().y() + parentGroupValues.y) * 100) / 100;

// Updated based on this bug report https://github.com/Creatide/AnimateMate/issues/27
// It seems that changing this one prevents object jumping after exporting, even exported content seems to be ok
// Tested with Sketch 44 version. Not sure if there is problems with other versions.
returnObj.x = Math.round((layer.frame().x()) * 100) / 100;
returnObj.y = Math.round((layer.frame().y()) * 100) / 100;

returnObj.width = Math.round(layer.frame().width() * 100) / 100;
returnObj.height = Math.round(layer.frame().height() * 100) / 100;
Expand Down Expand Up @@ -297,4 +300,4 @@ Animation.prototype.setOriginalValues = function (valuesObj, keyframeNumber, ref
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit d66fb90

Please sign in to comment.