Skip to content

Commit

Permalink
Remove duplicate import and refactor applyAspectRatio
Browse files Browse the repository at this point in the history
Co-authored-by: linusha <[email protected]>
  • Loading branch information
T4rikA and linusha committed Jun 10, 2021
1 parent b4761f4 commit 75c7d6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 1 addition & 5 deletions interactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 75c7d6a

Please sign in to comment.