-
Notifications
You must be signed in to change notification settings - Fork 2
73 reduce code duplication in canvas objects by implementing shared functionality in canvasobject #93
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
=======================================
Coverage 98.79% 98.79%
=======================================
Files 60 60
Lines 1493 1493
=======================================
Hits 1475 1475
Misses 18 18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
canvas_editor/static/js/editor/objects/movableCanvasObjects.mjs
Outdated
Show resolved
Hide resolved
|
A general note. I think the idea of separating the objects into different classes for each functionality is a very good idea, but in the current implementation we would have a Problem if a e.g. RotatableCanvasObject gets added. Maybe a different pattern would be more fitting here, as there is no multiple inheritance in Js. |
|
@plhrtr fair point, I implemented it as a composition pattern now. :) |
canvas_editor/static/js/editor/objects/movableCanvasObjects.mjs
Outdated
Show resolved
Hide resolved
plhrtr
left a comment
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.
Besides renaming the class, lgtm!
fluegelk
left a comment
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.
Mostly looking good, just a few comments to address
canvas_editor/static/js/editor/objects/movableCanvasObjects.mjs
Outdated
Show resolved
Hide resolved
…-by-implementing-shared-functionality-in-canvasobject
…nting-shared-functionality-in-canvasobject' of https://github.com/ARTIST-Association/CANVAS into 73-reduce-code-duplication-in-canvas-objects-by-implementing-shared-functionality-in-canvasobject
|



Refactored Receiver and Heliostat by introducing a new MovableCanvasObjects class to extract shared functionality not used by LightSource.