-
Notifications
You must be signed in to change notification settings - Fork 241
#4694 - Add Hotkeys in Macro mode similar to Micro mode #8895
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
Changes from all commits
50a1564
c2dd18f
0e04ac1
28da90c
672635e
f54fc87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,6 +210,12 @@ export class DrawingEntitiesManager { | |
| ); | ||
| } | ||
|
|
||
| public get hoveredEntities() { | ||
| return this.allEntities.filter( | ||
| ([, drawingEntity]) => drawingEntity.hovered, | ||
| ); | ||
| } | ||
|
Comment on lines
+213
to
+217
|
||
|
|
||
| public get selectedMonomers() { | ||
| return this.monomersArray.filter((monomer) => monomer.selected); | ||
| } | ||
|
|
@@ -298,6 +304,9 @@ export class DrawingEntitiesManager { | |
| } | ||
|
|
||
| public deleteSelectedEntities() { | ||
| if (this.hoveredEntities.length !== 0) { | ||
| return new Command(); | ||
| } | ||
| const mergedCommand = new Command(); | ||
| this.selectedEntities.forEach(([, drawingEntity]) => { | ||
| const command = this.deleteDrawingEntity(drawingEntity); | ||
|
|
@@ -306,6 +315,15 @@ export class DrawingEntitiesManager { | |
| return mergedCommand; | ||
| } | ||
|
|
||
| public deleteHoveredEntities() { | ||
| const mergedCommand = new Command(); | ||
| this.hoveredEntities.forEach(([, drawingEntity]) => { | ||
| const command = this.deleteDrawingEntity(drawingEntity); | ||
| mergedCommand.merge(command); | ||
| }); | ||
| return mergedCommand; | ||
| } | ||
|
Comment on lines
+318
to
+325
|
||
|
|
||
| public deleteAllEntities() { | ||
| const mergedCommand = new Command(); | ||
| this.allEntities.forEach(([, drawingEntity]) => { | ||
|
|
||
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 type cast 'as Command' is redundant because deleteSelectedEntities() already returns a Command type. Consider removing this cast for cleaner code.