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

feat: keyboard paste at pointer position #1311

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

Kneemund
Copy link
Collaborator

@Kneemund Kneemund commented Dec 3, 2024

Makes content pasted using CTRL + V appear at the cursor location instead of the top left corner of the page. Falls back to the previous behavior if the cursor is outside of the canvas.

@tunjan
Copy link

tunjan commented Dec 5, 2024

I get the following error when compiling the project with this commit. Am I doing something wrong?

error[E0599]: no function or associated item named `from_na_vec` found for struct `gtk4::graphene::Point` in the current scope
    --> crates/rnote-ui/src/appwindow/actions.rs:1093:67
     |
1093 |                         .compute_point(&canvas, &graphene::Point::from_na_vec(wrapper_point));
     |                                                                   ^^^^^^^^^^^ function or associated item not found in `Point`
     |
note: if you're trying to build a new `gtk4::graphene::Point` consider using one of the following associated functions:
      gtk4::graphene::Point::zero
      gtk4::graphene::point::<impl gtk4::graphene::Point>::new
      gtk4::graphene::point::<impl gtk4::graphene::Point>::from_vec2
    --> /home/tunjan/rnote/build/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/graphene-rs-0.20.4/src/auto/point.rs:69:5
     |
69   |     pub fn zero() -> Point {
     |     ^^^^^^^^^^^^^^^^^^^^^^
     |
    ::: /home/tunjan/rnote/build/cargo-home/registry/src/index.crates.io-6f17d22bba15001f/graphene-rs-0.20.4/src/point.rs:11:5
     |
11   |     pub fn new(x: f32, y: f32) -> Self {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
22   |     pub fn from_vec2(src: &Vec2) -> Point {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     = help: items from traits can only be used if the trait is in scope
help: trait `GraphenePointExt` which provides `from_na_vec` is implemented but not in scope; perhaps you want to import it
     |
2    + use rnote_engine::ext::GraphenePointExt;
     |
help: there is an associated function `from_glib_none_as_vec` with a similar name
     |
1093 |                         .compute_point(&canvas, &graphene::Point::from_glib_none_as_vec(wrapper_point));
     |                                                                   ~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rnote` (bin "rnote") due to 1 previous error
cargo call failed, code 25856

@Kneemund
Copy link
Collaborator Author

Kneemund commented Dec 5, 2024

Are you sure that you applied the commit correctly? You need to add use rnote_engine::ext::GraphenePointExt; according to the error message, but the commit already adds that.

@tunjan
Copy link

tunjan commented Dec 5, 2024

Yes, that was the issue. Thank you, it works as expected.

@tunjan
Copy link

tunjan commented Dec 21, 2024

Makes content pasted using CTRL + V appear at the cursor location instead of the top left corner of the page. Falls back to the previous behavior if the cursor is outside of the canvas.

* Fixes [Pasted content always appears in the top-left corner instead of at the cursor position #1304](https://github.com/flxzt/rnote/issues/1304).

I don't want to sound impatient. But what should we do before this pull request gets merged into the main branch?

@flxzt
Copy link
Owner

flxzt commented Dec 22, 2024

looks good, thanks @Kneemund !

@flxzt flxzt merged commit 10e6d87 into flxzt:main Dec 22, 2024
2 checks passed
@Kneemund Kneemund deleted the feat/paste-at-pointer branch December 22, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasted content always appears in the top-left corner instead of at the cursor position
3 participants