From 3416da88208a152f9c031f3788e5e5d9b3ccff49 Mon Sep 17 00:00:00 2001 From: ru_shalm Date: Sun, 19 May 2019 17:43:52 +0900 Subject: [PATCH] Fix progress bar width for small width games Fixed an issue where the progress bar was larger than the game screen, if I set the `screenWidth` value to less than 610 in `CommunityBasic.js` --- js/rpg_core/Graphics.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/rpg_core/Graphics.js b/js/rpg_core/Graphics.js index 8eacfc99..030804c1 100644 --- a/js/rpg_core/Graphics.js +++ b/js/rpg_core/Graphics.js @@ -269,7 +269,6 @@ Graphics.startLoading = function() { Graphics._setupProgress = function(){ this._progressElement = document.createElement('div'); this._progressElement.id = 'loading-progress'; - this._progressElement.width = 600; this._progressElement.height = 300; this._progressElement.style.visibility = 'hidden'; @@ -281,6 +280,7 @@ Graphics._setupProgress = function(){ this._barElement.style.border = '5px solid white'; this._barElement.style.borderRadius = '15px'; this._barElement.style.marginTop = '40%'; + this._barElement.style.boxSizing = 'border-box'; this._filledBarElement = document.createElement('div'); this._filledBarElement.id = 'loading-filled-bar'; @@ -321,6 +321,7 @@ Graphics._updateProgressCount = function(countLoaded, countLoading){ }; Graphics._updateProgress = function(){ + this._progressElement.width = Math.min(this._width * 0.9, 600); this._centerElement(this._progressElement); };