From 844765bde616297b5ed4f07e99b60e92c9b7b791 Mon Sep 17 00:00:00 2001 From: Deniz Ozkaynak Date: Sat, 13 Oct 2018 20:35:10 -0400 Subject: [PATCH 1/2] Created a variable to replace a hardcoded value In ../src/editor/ui/UI.js there's a random hardcoded value of 136 that helps determine the scale of fullscreen mode. Not sure what this number represents but it should be a variable. --- src/utils/lib.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/lib.js b/src/utils/lib.js index f9a94d6..e5cbf8b 100755 --- a/src/utils/lib.js +++ b/src/utils/lib.js @@ -6,6 +6,7 @@ export const DEGTOR = Math.PI / 180; export const WINDOW_INNER_HEIGHT = window.innerHeight; export const WINDOW_INNER_WIDTH = window.innerWidth; export const scaleMultiplier = WINDOW_INNER_HEIGHT / 768.0; +export const fullscreenScaleMultiplier = 136; export const isiOS = (typeof AndroidInterface == 'undefined'); export const isAndroid = (typeof AndroidInterface != 'undefined'); From ae0d60cb43baa4f424a6215e90d2d9db5f98acd3 Mon Sep 17 00:00:00 2001 From: Deniz Ozkaynak Date: Sat, 13 Oct 2018 20:36:29 -0400 Subject: [PATCH 2/2] Replaced hardcoded value of 136 with a variable. --- src/editor/ui/UI.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/editor/ui/UI.js b/src/editor/ui/UI.js index bb08f38..a772cb3 100644 --- a/src/editor/ui/UI.js +++ b/src/editor/ui/UI.js @@ -20,7 +20,7 @@ import Paint from '../../painteditor/Paint'; import Events from '../../utils/Events'; import Localization from '../../utils/Localization'; import ScratchAudio from '../../utils/ScratchAudio'; -import {frame, gn, CSSTransition, localx, newHTML, scaleMultiplier, getIdFor, isTablet, newDiv, +import {frame, gn, CSSTransition, localx, newHTML, scaleMultiplier, fullscreenScaleMultiplier, getIdFor, isTablet, newDiv, newTextInput, isAndroid, getDocumentWidth, getDocumentHeight, setProps, globalx} from '../../utils/lib'; let projectNameTextInput = null; @@ -809,7 +809,7 @@ export default class UI { gn(list[i]).className = gn(list[i]).className + ' presentationmode'; frame.appendChild(gn(list[i])); } - var scale = Math.min((w - (136 * scaleMultiplier)) / gn('stage').owner.width, h / gn('stage').owner.height); + var scale = Math.min((w - (fullscreenScaleMultiplier * scaleMultiplier)) / gn('stage').owner.width, h / gn('stage').owner.height); var dx = Math.floor((w - (gn('stage').owner.width * scale)) / 2); var dy = Math.floor((h - (gn('stage').owner.height * scale)) / 2);