diff --git a/package.json b/package.json index c8bef16..b0fd280 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "real-debrid-downloader", - "version": "1.4.99", + "version": "1.5.0", "description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)", "main": "build/main/main/main.js", "author": "Sucukdeluxe", diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index d41b155..0fda829 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -155,17 +155,13 @@ const BandwidthChart = memo(function BandwidthChart({ items, running, paused }: if (!ctx) return; const dpr = window.devicePixelRatio || 1; - const rect = container.getBoundingClientRect(); - if (rect.width <= 0 || rect.height <= 0) return; + const width = container.clientWidth; + const height = container.clientHeight; + if (width <= 0 || height <= 0) return; - canvas.width = rect.width * dpr; - canvas.height = rect.height * dpr; - canvas.style.width = `${rect.width}px`; - canvas.style.height = `${rect.height}px`; + canvas.width = width * dpr; + canvas.height = height * dpr; ctx.scale(dpr, dpr); - - const width = rect.width; - const height = rect.height; const padding = { top: 20, right: 20, bottom: 30, left: 60 }; const chartWidth = width - padding.left - padding.right; const chartHeight = height - padding.top - padding.bottom;