73 reduce code duplication in canvas objects by implementing shared functionality in canvasobject#93
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.
Besides renaming the class, lgtm!
fluegelk
left a comment
There was a problem hiding this comment.
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.