close
The Wayback Machine - https://web.archive.org/web/20220515065545/https://github.com/fdehau/tui-rs/issues/352
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

Document x, y coordinates #352

Open
Luro02 opened this issue Aug 18, 2020 · 5 comments
Open

Document x, y coordinates #352

Luro02 opened this issue Aug 18, 2020 · 5 comments

Comments

@Luro02
Copy link

@Luro02 Luro02 commented Aug 18, 2020

It would be nice if one could document how the x and y coordinates are defined. (Beginners might not know about it and well the more documentation the better).

What I think when I see x and y:

image
image2

What it actually is:

image3

Relevant structs

  • tui::layout::Rect
  • tui::widgets::canvas::*
@Luro02 Luro02 added the bug label Aug 18, 2020
@fdehau
Copy link
Owner

@fdehau fdehau commented Aug 23, 2020

I agree the axis can be confusing. The main issue is that most the widgets use (x, y) for something that should actually be (col, row). The canvas uses Cartesian axis for the data though.

Is this something you would help clarify in the documentation ?

@Luro02
Copy link
Author

@Luro02 Luro02 commented Aug 23, 2020

I am not sure if I am the correct person for this. I have absolutely no clue about this crate (never used it, just looked a bit through the docs), but I will keep this issue in mind and make a PR, when I have time for it.

@fdehau
Copy link
Owner

@fdehau fdehau commented Aug 23, 2020

Ok sure thing. Thanks for the report anyway. I've requalified the issue in the meantime.

@stbor
Copy link

@stbor stbor commented Sep 13, 2020

Need terms and conditions

@fdehau
Copy link
Owner

@fdehau fdehau commented Sep 20, 2020

@stbor I think the best approach would be to have a different vocabulary for each coordinates system:

  • We should use the row and column denomination for everything that deals with the grid system we are using to represent the terminal (i.e all widgets rendering code).
  • We should use x, y when we are referring to a more traditional Cartesian coordinates system (i.e the abstraction Canvas is built on top of).
    While this task should be easy as it should only be basic substitutions, it is probably big given the amount of code to change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants