Skip to content

Commit

Permalink
[enhancement] set resolution to be 1:1 when previewing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgervang committed Jul 21, 2021
1 parent 8e2687c commit 1b6978f
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export class ExportVideoPanelContainer extends Component {

getCanvasSize() {
const {resolution} = this.state;
return getResolutionSetting(resolution);
const {width, height} = getResolutionSetting(resolution);
return {width, height};
}

_getContainer() {
Expand Down Expand Up @@ -319,7 +320,8 @@ export class ExportVideoPanelContainer extends Component {
fileName,
resolution,
viewState,
rendering
rendering,
previewing
} = this.state;

const timecode = this.getTimecode();
Expand All @@ -337,7 +339,11 @@ export class ExportVideoPanelContainer extends Component {
frameRate: timecode.framerate
};

const {width, height} = this.getCanvasSize();
let canvasSize = this.getCanvasSize();
if (previewing) {
// set resolution to be 1:1 with container when previewing to improve performance.
canvasSize = this._getContainer();
}

return (
<ExportVideoPanel
Expand All @@ -358,7 +364,7 @@ export class ExportVideoPanelContainer extends Component {
adapter={adapter}
handlePreviewVideo={this.onPreviewVideo}
handleRenderVideo={this.onRenderVideo}
resolution={[width, height]}
resolution={[canvasSize.width, canvasSize.height]}
rendering={rendering}
/>
);
Expand Down

0 comments on commit 1b6978f

Please sign in to comment.