👌 unimplement canvas stretching behavior

This commit is contained in:
ghalestrilo 2020-06-30 17:01:24 -03:00
parent 30c47d6fe5
commit 1c1ea98a0b
2 changed files with 1 additions and 9 deletions

View file

@ -200,11 +200,6 @@ class PreviewFrame extends React.Component {
this.addLoopProtect(sketchDoc); this.addLoopProtect(sketchDoc);
sketchDoc.head.insertBefore(consoleErrorsScript, sketchDoc.head.firstElement); sketchDoc.head.insertBefore(consoleErrorsScript, sketchDoc.head.firstElement);
if (this.props.forceFullWidth) {
const resizeScript = sketchDoc.createElement('style');
resizeScript.innerHTML = '.p5Canvas { width: 100% !important; height: auto !important }';
sketchDoc.head.appendChild(resizeScript);
}
return `<!DOCTYPE HTML>\n${sketchDoc.documentElement.outerHTML}`; return `<!DOCTYPE HTML>\n${sketchDoc.documentElement.outerHTML}`;
} }
@ -389,13 +384,11 @@ PreviewFrame.propTypes = {
clearConsole: PropTypes.func.isRequired, clearConsole: PropTypes.func.isRequired,
cmController: PropTypes.shape({ cmController: PropTypes.shape({
getContent: PropTypes.func getContent: PropTypes.func
}), })
forceFullWidth: PropTypes.bool
}; };
PreviewFrame.defaultProps = { PreviewFrame.defaultProps = {
fullView: false, fullView: false,
forceFullWidth: false,
cmController: {} cmController: {}
}; };

View file

@ -67,7 +67,6 @@ const MobileSketchView = (props) => {
content={selectedFile.content} content={selectedFile.content}
isPlaying isPlaying
forceFullWidth
isAccessibleOutputPlaying={ide.isAccessibleOutputPlaying} isAccessibleOutputPlaying={ide.isAccessibleOutputPlaying}
previewIsRefreshing={ide.previewIsRefreshing} previewIsRefreshing={ide.previewIsRefreshing}