-
-
Notifications
You must be signed in to change notification settings - Fork 462
Closed
Labels
Type: EnhancementNew feature or requestNew feature or request
Description
Problem
I am trying to implement some vector drawing with ratatui, but I face problem. The ratatui::widgets::canvas::Line
method can't draw a line if one of the points is outside the window. In theory I can calculate the intersection and draw a shorter line, but I need to know the resolution from Shape
. get_point
doesn't help because it just returns none if the point is outside. Also context
is a private field and I don't have access to the required fields.
Solution
I see few solutions:
- Public access to context in Painter.
- Additional methods like resolution and context bounds
- New property for widgets that need context
Alternatives
I can use context before calling draw or draw without shape implementation, but it doesn't look consistent.
Additional context
I can try to implement some of the solution, but I am not sure which way is better
Metadata
Metadata
Assignees
Labels
Type: EnhancementNew feature or requestNew feature or request