(&self, tooltip_width: f64, tooltip_height: f64)
| 521 | } |
| 522 | |
| 523 | fn get_tooltip_position(&self, tooltip_width: f64, tooltip_height: f64) -> Point<f64> { |
| 524 | let channels = self.base.channels.borrow(); |
| 525 | let channel = channels.first().unwrap(); |
| 526 | |
| 527 | let focused_entity_index = self.base.props.borrow().focused_entity_index as usize; |
| 528 | |
| 529 | let props = self.props.borrow(); |
| 530 | |
| 531 | let pie = channel.entities.get(focused_entity_index).unwrap(); |
| 532 | let angle = 0.5 * (pie.start_angle + pie.end_angle); |
| 533 | let radius = 0.5 * (props.inner_radius + props.outer_radius); |
| 534 | let point = utils::polar2cartesian(&props.center, radius, angle); |
| 535 | let x = point.x - 0.5 * tooltip_width; |
| 536 | let y = point.y - tooltip_height; |
| 537 | Point::new(x, y) |
| 538 | } |
| 539 | } |
nothing calls this directly
no test coverage detected