From 685dd5a78804ac3c74f6a493f574ec2f4406ec70 Mon Sep 17 00:00:00 2001 From: T4rikA Date: Thu, 10 Jun 2021 17:42:18 +0200 Subject: [PATCH] Remove duplicate import and refactor applyAspectRatio Co-authored-by: linusha --- editor.js | 2 -- interactive.js | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/editor.js b/editor.js index 6d17babaf..8b521b6d8 100644 --- a/editor.js +++ b/editor.js @@ -19,9 +19,7 @@ import { InteractiveGraph } from './tree.js'; import { SocialMediaButton } from './components/social-media-button.js'; import { error, success } from './utilities/messages.js'; import { Canvas } from 'lively.components/canvas.js'; -import { LabeledCheckBox } from 'lively.components/widgets.js'; import { TIMELINE_CONSTANTS } from './timeline/constants.js'; - import { LabeledCheckBox, DropDownSelector } from 'lively.components/widgets.js'; const CONSTANTS = { diff --git a/interactive.js b/interactive.js index 2e1394d3e..edaea6e44 100644 --- a/interactive.js +++ b/interactive.js @@ -102,11 +102,7 @@ export class Interactive extends DeserializationAwareMorph { applyAspectRatio (extent, calculateAspectRatio = false) { let aspectRatio; - if (calculateAspectRatio) { - aspectRatio = this.width / this.height; - } else { - aspectRatio = this.fixedAspectRatio; - } + aspectRatio = calculateAspectRatio ? this.width / this.height : this.fixedAspectRatio; return pt(aspectRatio ? extent.y * aspectRatio : extent.x, extent.y); }