GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
9.47k stars 457 forks source link

Path Tool: Changed reference coordinates and added different behaviors for Mouse and Keyboard Inputs #2094

Closed Kukkarmutta closed 1 week ago

Kukkarmutta commented 3 weeks ago

Closes #2083

Hello, this is my first contribution. Hope the issue is resolved as intended. If I've made any mistake or there is room for improvement, do let me know :)

Details:

The move_selected_points function is used in dragging as well as for keyboard nudging, so modifying its default coordinate system initially resulted in undesirable dragging behaviour. Edited move_selected_points function. Added a bool parameter to check whether we're using keyboard (1) or dragging (0). If we use keyboard it will now use document coords as reference, but for dragging it uses default coordinate system

Keavon commented 3 weeks ago

Hi, welcome! Please be sure to run cargo fmt, and set up your text editor to run it automatically when saving the file. (This should already be the default in VS Code if you have the Rust Analyzer extension installed, but you'll have to figure out how to do that in other editors yourself.) Once you commit the formatted code, I can begin reviewing this. Thanks!

Kukkarmutta commented 3 weeks ago

Hello Again. Although I had rust-analyser installed, I have run the formatting command. Kindly review and let me know if any further changes are required.

Edit: I assume by formatting you meant that the function parameters are now placed on a new line. After running cargo fmt it still puts them in a newer line which was not how it was formatted in the original code. I've fixed this manually for now, but is there a way to configure fmt command to place them inline?

Keavon commented 3 weeks ago

!build

Keavon commented 3 weeks ago

It looks like the code doesn't compile. Have you thoroughly tested everything, including both the intended functionality and other likely regressions? I'll mark this as a draft until you have it working. Thanks!

Kukkarmutta commented 3 weeks ago

When I tried to fix it manually idk what happened and some lines got deleted :') (i noticed that much later)
im fixing that issue and will submit it in a few minutes

Keavon commented 1 week ago

2083 was closed by #2095 last week.