Closed themasch closed 8 years ago
This is somewhat related to #4.
I am currently re-doing the text positioning. Once it's done, it should be fairly easy (and different than it is now) to compute the click's line number. We can get the column using the glium_text::get_char_pos_x(n) function. This function returns the offset of a given character. It's parameter is a position of the character, in bytes.
Best to wait for the changes with this.
EDIT: The get_char_pos_x is that way because that is what the back-end does for the cursor position. It is used in src/renderer.rs:40.
Updated a comment on get_char_pos_x, so it (hopefully) describes the result accurately (cf32132).
okay, I think we should close this PR and I'll open a new one with the new implementation.
I finished a simple mouse-click implementation. Used some code from this PR.
i'm having a little trouble adding mouse support since I don't know how to correctly map an on-screen x coordinate to the matching column. I think I'm missing an offset/padding and might use a wrong factor. Any suggestions?