From 6aa9e19ac3c2010919852dde8e7d7948da614c59 Mon Sep 17 00:00:00 2001 From: MartinFillon Date: Sat, 2 Dec 2023 00:04:01 +0100 Subject: [PATCH] fix(color-scale): color-scale broked size for colors see #684 and #682 and #414 --- src/output/render/size.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/output/render/size.rs b/src/output/render/size.rs index e36260f81..be7aa937d 100644 --- a/src/output/render/size.rs +++ b/src/output/render/size.rs @@ -23,7 +23,6 @@ impl f::Size { Self::DeviceIDs(ref ids) => return ids.render(colours), }; - let gradient_style = colours.major(); let is_gradient_mode = color_scale_info.is_some_and(|csi| csi.options.mode == ColorScaleMode::Gradient); @@ -44,7 +43,7 @@ impl f::Size { return if is_gradient_mode { let csi = color_scale_info.unwrap(); TextCell::paint( - csi.adjust_style(gradient_style, size as f32, csi.size), + csi.adjust_style(colours.size(prefix), size as f32, csi.size), string, ) } else { @@ -59,7 +58,7 @@ impl f::Size { return if is_gradient_mode { let csi = color_scale_info.unwrap(); TextCell::paint( - csi.adjust_style(gradient_style, size as f32, csi.size), + csi.adjust_style(colours.size(None), size as f32, csi.size), numerics.format_int(b), ) } else { @@ -82,9 +81,9 @@ impl f::Size { contents: if is_gradient_mode { let csi = color_scale_info.unwrap(); vec![ - csi.adjust_style(gradient_style, size as f32, csi.size) + csi.adjust_style(colours.size(Some(prefix)), size as f32, csi.size) .paint(number), - csi.adjust_style(gradient_style, size as f32, csi.size) + csi.adjust_style(colours.size(Some(prefix)), size as f32, csi.size) .paint(symbol), ] } else {