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
Gaphas 3 support #501
Gaphas 3 support #501
Conversation
* no more Item.normalize() * canvas.update() has been removed -> updates via GtkView * Painter code has been reorganized
- painters - merge view
Co-authored-by: Sourcery AI <>
Fix some issues. Not all.
All that's missing is transaction support.
d22c482
to
0f24ba3
Compare
This may fix the windows build.
Cleaned up mypy config.
They will be removed from Gaphas.
Somehow loading of models is broken, though!
Update matrix_i2c (item to common) before making connections.
yield item | ||
yield from self._tree.get_ancestors(item) | ||
|
||
all_dirty_items = list(reversed(list(sort(dirty_items_with_ancestors())))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to call sorted(list(dirty_items_with_ancestors())), reversed=True)
? I got a lot lost here and below on line 293 to be honest with sorting the generator, converting it to a list, reversing it, and then creating another list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sort()
method is coming from the canvas.
It's not the prettiest bit of code. I removed the reversed
flag from the sort method: it was only used for this case, and I remove pre/post_update
methods from the library, therefore it seemed to make sense to remove the reversed
argument as well. It's a bummer you can only reverse a list and not a iterable.
My cunning plan is to het rid of pre/post_update in gaphor as well. We'll have to see how that works out, though :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really awesome job migrating everything to support the updates to Gaphas! 👍 I saw you started to use EventControllers which also looks really good.
Sorry most of my comments are nitpicks 😄
return gesture | ||
|
||
|
||
def on_drag_begin(gesture, start_x, start_y, placement_state): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed some of the new code doesn't have type hints, did we want to add those in before merging?
Signed-off-by: Dan Yeaw <dan@yeaw.me> # Conflicts: # poetry.lock
I noticed that redraws do not happen, when undo'ing. I have to look into it. Update: fixed |
That made it in to Git. Thanks @danyeaw!
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.28%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The Gaphas 2 architecture is 10+ years old. We want to add some new features (e.g. grey our elements a line can not connect to) we need an upgrade of the library.
See: https://github.com/orgs/gaphor/projects/1
What is the new behavior?
In this branch I'll keep up to date with the changes made to gaphas, so I do not have to make all changes in one shot after a new Gaphas version has been released. I tried to limit the changes and add functionality that was removed from gaphas (like pre/post update). This way I hope to limit the actual code change.
Diagram
implements thegaphas.view.Model
protocolpre/post_update()
is no longer part of Gaphas. Has been implemented in Gaphor for the time being.connections
object. Used to manage in- and external constraints.dropzone_item
and dragged item/handle at some pointFuture work
Diagram
should replace the functionality ofgaphas.Canvas
Does this PR introduce a breaking change?
Other information