Account for sidebar width when calculating zoom-to-fit scale

pull/5551/head
Nick O'Leary 2026-03-10 11:44:39 +00:00
parent 78660d4028
commit d8519a91c2
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 2 additions and 2 deletions

View File

@ -3001,8 +3001,8 @@ RED.view = (function() {
var boundingWidth = maxX - minX;
var boundingHeight = maxY - minY;
// Get viewport dimensions
var viewportWidth = chart.width();
// Get viewport dimensions - accounting for the sidebar if visible
var viewportWidth = chart.width() - $("#red-ui-sidebar").width();
var viewportHeight = chart.height();
// Calculate zoom level that fits bounding box in viewport