Camera: calculate control points on the fly#1738
Merged
J5lx merged 10 commits intopencil2d:masterfrom Jan 26, 2023
Merged
Conversation
with the introduction to a paint method that can now be overridden.
Member
Author
|
Agh, I forgot to update the tests, will do that tomorrow... |
- added test for recovering control point on delete keyframe - added test for preserving curve on add keyframe
Member
Author
|
Tests now updated, PR is ready :) |
J5lx
approved these changes
Jan 26, 2023
Member
J5lx
left a comment
There was a problem hiding this comment.
LGTM! I like the control point merge logic, and nice refactoring and fixes too. Great job! Will merge once checks have completed.
dc46cef to
5c00796
Compare
Member
|
Alright, finally got the build failures sorted out… |
Member
Author
|
Thanks for reviewing, fixing build errors and merging! 💯 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For this PR the goal has been to create stronger coupling between the camera tool and the painter that handled the interactive parts. This has been done by introducing a BaseTool::paint(...) method which allows us to perform calculations that can both be used by the tool and its painter without addition branching in Scribbearea. One example where we benefit from this is when calculating the centered control point instead of having to explicitly set it at various times. Another example is when calculating the distance between the rotation anchor, its line and the camera frame, as this has to be done two places, locally in the tool and in the world coordinate space.
Fixes
How to reproduce:
Result: The rotation anchor has been positioned further away from the frame or if decreased, position closer to the frame.
Sometimes dragging the last control handle would drag the previous instead...
Reworked recovery logic for splitting and merging control points
Changes