Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(canvas): add documentation for x_bounds, y_bounds #35

Merged
merged 2 commits into from
Mar 19, 2023
Merged

Conversation

orhun
Copy link
Member

@orhun orhun commented Feb 12, 2023

Upstream: #666

Description

There is no description in docs for Canvas::x_bounds and Canvas::y_bounds, but there is a question about that with response of the author. So this PR puts this response as documentation for the methods with some small corrections and formatting.

Testing guidelines

This PR does not add any code, but all code fragments in documentation are valid & buildable.

Checklist

@mindoodoo mindoodoo added the Type: Documentation Improvements or additions to documentation label Feb 14, 2023
@mindoodoo mindoodoo added this to the First Release milestone Feb 19, 2023
Copy link
Member

@mindoodoo mindoodoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we don't really need the examples in the end. If the issue is ever brought up again we can add them back in, but for the time being we could simplify this

Comment on lines 426 to 445
/// # Examples
///
/// ```
/// # use tui::style::Color;
/// # use tui::widgets::{Block, Borders};
/// # use tui::widgets::canvas::{Canvas, Map, MapResolution};
/// let canvas = Canvas::default()
/// .block(Block::default().borders(Borders::ALL).title("World"))
/// .paint(|ctx| {
/// ctx.draw(&Map {
/// color: Color::White,
/// resolution: MapResolution::High,
/// });
/// })
/// .x_bounds([-180.0, 180.0])
/// .y_bounds([-90.0, 90.0]);
/// ```
///
/// If you were to "zoom" to a certain part of the world you may want to choose different
/// bounds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not really needed ? A bit wordy

Comment on lines 394 to 413
/// # Examples
///
/// ```
/// # use tui::style::Color;
/// # use tui::widgets::{Block, Borders};
/// # use tui::widgets::canvas::{Canvas, Map, MapResolution};
/// let canvas = Canvas::default()
/// .block(Block::default().borders(Borders::ALL).title("World"))
/// .paint(|ctx| {
/// ctx.draw(&Map {
/// color: Color::White,
/// resolution: MapResolution::High,
/// });
/// })
/// .x_bounds([-180.0, 180.0])
/// .y_bounds([-90.0, 90.0]);
/// ```
///
/// If you were to "zoom" to a certain part of the world you may want to choose different
/// bounds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not really need ? A bit wordy.

Copy link
Member

@sayanarijit sayanarijit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mindoodoo @orhun Feel free to merge the suggested changes if you agree with it.

src/widgets/canvas/mod.rs Outdated Show resolved Hide resolved
src/widgets/canvas/mod.rs Outdated Show resolved Hide resolved
@orhun orhun changed the title Add documentation for x_bounds, y_bounds docs(canvas): add documentation for x_bounds, y_bounds Mar 19, 2023
@orhun orhun merged commit 33e67ab into main Mar 19, 2023
@joshka joshka deleted the 666/master branch July 4, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants