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

Commit

Permalink
Fix #3709 and fix #3669, remove oversampling of canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
testeaxeax committed Nov 10, 2017
1 parent 73f7939 commit 5dc6f22
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/src/pages/shot/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports.Editor = class Editor extends React.Component {
</div>
<div className="main-container">
<div className="canvas-container" id="canvas-container" ref={(canvasContainer) => this.canvasContainer = canvasContainer}>
<canvas className="image-holder centered" id="image-holder" ref={(image) => { this.imageCanvas = image }} height={ 2 * canvasHeight } width={ 2 * canvasWidth } style={{height: canvasHeight, width: canvasWidth}}></canvas>
<canvas className="image-holder centered" id="image-holder" ref={(image) => { this.imageCanvas = image }} height={ canvasHeight } width={ canvasWidth } style={{height: canvasHeight, width: canvasWidth}}></canvas>
<canvas className="highlighter centered" id="highlighter" ref={(highlighter) => { this.highlighter = highlighter }} height={canvasHeight} width={canvasWidth}></canvas>
<canvas className={"editor centered " + this.state.tool} id="editor" ref={(editor) => { this.editor = editor }} height={canvasHeight} width={canvasWidth}></canvas>
</div>
Expand Down Expand Up @@ -78,12 +78,10 @@ exports.Editor = class Editor extends React.Component {
this.highlightContext = this.highlighter.getContext('2d');
let imageContext = this.imageCanvas.getContext('2d');
this.imageContext = imageContext;
// From https://blog.headspin.com/?p=464, we oversample the canvas for improved image quality
let img = new Image();
img.src = this.props.clip.image.url;
let width = this.props.clip.image.dimensions.x;
let height = this.props.clip.image.dimensions.y;
this.imageContext.scale(2, 2);
this.imageContext.drawImage(img, 0, 0, width, height);
this.edit();
}
Expand Down

0 comments on commit 5dc6f22

Please sign in to comment.