(
&mut self,
id: u32,
z_index: i16,
config: ScrollbarConfig,
alpha_mul: f32,
vertical: Option<ScrollbarAxisGeometry>,
horizontal: Option<Scrollb
| 7012 | } |
| 7013 | |
| 7014 | fn render_scrollbar_geometry( |
| 7015 | &mut self, |
| 7016 | id: u32, |
| 7017 | z_index: i16, |
| 7018 | config: ScrollbarConfig, |
| 7019 | alpha_mul: f32, |
| 7020 | vertical: Option<ScrollbarAxisGeometry>, |
| 7021 | horizontal: Option<ScrollbarAxisGeometry>, |
| 7022 | ) { |
| 7023 | if alpha_mul <= 0.0 { |
| 7024 | return; |
| 7025 | } |
| 7026 | |
| 7027 | let thumb_color = apply_alpha(config.thumb_color, alpha_mul); |
| 7028 | let track_color = config.track_color.map(|c| apply_alpha(c, alpha_mul)); |
| 7029 | |
| 7030 | if let Some(v) = vertical { |
| 7031 | if let Some(track) = track_color { |
| 7032 | self.add_render_command(InternalRenderCommand { |
| 7033 | bounding_box: v.track_bbox, |
| 7034 | command_type: RenderCommandType::Rectangle, |
| 7035 | render_data: InternalRenderData::Rectangle { |
| 7036 | background_color: track, |
| 7037 | corner_radius: config.corner_radius.into(), |
| 7038 | }, |
| 7039 | id: hash_number(id, 8001).id, |
| 7040 | z_index, |
| 7041 | ..Default::default() |
| 7042 | }); |
| 7043 | } |
| 7044 | |
| 7045 | self.add_render_command(InternalRenderCommand { |
| 7046 | bounding_box: v.thumb_bbox, |
| 7047 | command_type: RenderCommandType::Rectangle, |
| 7048 | render_data: InternalRenderData::Rectangle { |
| 7049 | background_color: thumb_color, |
| 7050 | corner_radius: config.corner_radius.into(), |
| 7051 | }, |
| 7052 | id: hash_number(id, 8002).id, |
| 7053 | z_index, |
| 7054 | ..Default::default() |
| 7055 | }); |
| 7056 | } |
| 7057 | |
| 7058 | if let Some(h) = horizontal { |
| 7059 | if let Some(track) = track_color { |
| 7060 | self.add_render_command(InternalRenderCommand { |
| 7061 | bounding_box: h.track_bbox, |
| 7062 | command_type: RenderCommandType::Rectangle, |
| 7063 | render_data: InternalRenderData::Rectangle { |
| 7064 | background_color: track, |
| 7065 | corner_radius: config.corner_radius.into(), |
| 7066 | }, |
| 7067 | id: hash_number(id, 8003).id, |
| 7068 | z_index, |
| 7069 | ..Default::default() |
| 7070 | }); |
| 7071 | } |
no test coverage detected