Skip to content

Commit ee229b9

Browse files
committed
Fix logic for setting maxheight value
1 parent c0e6fd6 commit ee229b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/components/legend/draw.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,12 @@ function computeLegendDimensions(gd, groups, traces, legendObj) {
794794
isBelowPlotArea = yPixels < plotBottom || (yPixels === plotBottom && yanchor === 'top');
795795
isAbovePlotArea = yPixels > plotTop || (yPixels === plotTop && yanchor === 'bottom');
796796
// Use the container height as the reference height
797+
useFullLayoutHeight = false;
797798
referenceHeight = fullLayout.height;
798799
}
799800

800801
// Set default maxheight if not provided by user
801-
maxheight ||= (yref === 'paper' && !useFullLayoutHeight) ? 1 : 0.5;
802+
maxheight ||= (useFullLayoutHeight) ? 0.5 : 1;
802803
// Convert maxheight to pixels if it's a ratio (≤1), otherwise use as-is
803804
if (maxheight <= 1) {
804805
maxheight = maxheight * referenceHeight;

0 commit comments

Comments
 (0)