From e6782b6aacb2f005af45afb7c7abdd42fe8cabb7 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sun, 3 Dec 2023 22:43:48 -0500 Subject: [PATCH] Working spectrum in grid --- gui/src/assets/waterfall/spectrum.js | 10 ++++--- gui/src/components/grid_active_stats.vue | 36 ++++++++---------------- gui/src/components/main_active_stats.vue | 13 +++++---- gui/src/js/waterfallHandler.js | 19 ++++++------- 4 files changed, 33 insertions(+), 45 deletions(-) diff --git a/gui/src/assets/waterfall/spectrum.js b/gui/src/assets/waterfall/spectrum.js index df217091..81c3a60d 100644 --- a/gui/src/assets/waterfall/spectrum.js +++ b/gui/src/assets/waterfall/spectrum.js @@ -274,14 +274,16 @@ Spectrum.prototype.updateSpectrumRatio = function () { }; Spectrum.prototype.resize = function () { - var width = this.canvas.clientWidth; - var height = this.canvas.clientHeight; + var width = this.parent.clientWidth; + var height =this.parent.clientHeight; // little helper for setting height of clientHeight is not working as expected if (height == 0){ var height = 250 } - + if (width == 0){ + width=500; + } if (this.canvas.width != width || this.canvas.height != height) { this.canvas.width = width; @@ -473,7 +475,7 @@ export function Spectrum(id, options) { // Create main canvas and adjust dimensions to match actual this.canvas = document.getElementById(id); - + this.parent = this.canvas.parentElement; this.canvas.height = this.canvas.clientHeight; this.canvas.width = this.canvas.clientWidth; diff --git a/gui/src/components/grid_active_stats.vue b/gui/src/components/grid_active_stats.vue index 643de101..5902fe3b 100644 --- a/gui/src/components/grid_active_stats.vue +++ b/gui/src/components/grid_active_stats.vue @@ -1,7 +1,7 @@ - -