Splitting drawings via GUI #281
Open
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.
This is a WIP feature implementation, but I would like to hear your thoughts anyway.
What this is for
The original Wacom Inkspace app has a "split drawing" feature, it is really useful if you forgot to press that only button the device has and now are left with two drawings overlayed. This PR adds a dialog to Tuhi where the user can select a split position via slider:
Open Questions
Timestamp as ID
AFAIK, a drawing is uniquely defined through its UNIX timestamp in seconds. In this working implementation, if the user splits a drawing, the part that is split off gets assigned timestamp + 1, since assigning it the current timestamp would mess up the display order. However, if the user decides to split the first part again, a collision occurs. This might not happen very often, but I would suggest changing the Identifier from timestamp to either timestamp + some sort of hash or add precision (e.g. milliseconds) to avoid problems of that kind altogether. Any thoughts?
Drawing rendering
The PR also contains code to render a drawing from its json_data into a
Gtk.DrawingAreawith cairo. It is more responsive to changes than the current "exported SVG" approach, however I have not benchmarked its performance. Would it make sense to replace the rendering drawings in the DrawingPerspective with it?