Skip to content

Commit

Permalink
fix(color-scale): color-scale broked size for colors
Browse files Browse the repository at this point in the history
see #684 and #682
  • Loading branch information
MartinFillon committed Dec 1, 2023
1 parent 0ac89a0 commit ad4cb50
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/output/render/size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit ad4cb50

Please sign in to comment.