-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Roman Rodionov <[email protected]> Co-authored-by: Alexey Girin <[email protected]>
- Loading branch information
Showing
96 changed files
with
2,831 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-92 Bytes
(98%)
...ols.spec.ts-snapshots/Reaction-Tools-Icons-for-Arrow-Tools-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+219 Bytes
(100%)
...toolbar-UI-tests-left-toolbar-reaction-arrows-verification-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
packages/ketcher-core/src/application/editor/actions/multitailArrow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { MultitailArrowReferencePosition, ReStruct } from 'application/render'; | ||
import { | ||
Action, | ||
MultitailArrowDelete, | ||
MultitailArrowUpsert, | ||
MultitailArrowMove, | ||
MultitailArrowAddTail, | ||
MultitailArrowRemoveTail, | ||
MultitailArrowResizeTailHead, | ||
MultitailArrowMoveHeadTail, | ||
} from 'application/editor'; | ||
import { Vec2, MultitailArrow } from 'domain/entities'; | ||
|
||
export function fromMultitailArrowCreation( | ||
reStruct: ReStruct, | ||
topLeft: Vec2, | ||
bottomRight: Vec2, | ||
) { | ||
const action = new Action(); | ||
const multitailArrow = MultitailArrow.fromTwoPoints(topLeft, bottomRight); | ||
action.addOp(new MultitailArrowUpsert(multitailArrow)); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowDeletion(reStruct: ReStruct, id: number) { | ||
const action = new Action(); | ||
action.addOp(new MultitailArrowDelete(id)); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowMove( | ||
reStruct: ReStruct, | ||
id: number, | ||
offset: Vec2, | ||
) { | ||
const action = new Action(); | ||
|
||
action.addOp(new MultitailArrowMove(id, offset)); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowTailAdd(reStruct: ReStruct, id: number) { | ||
const action = new Action(); | ||
|
||
action.addOp(new MultitailArrowAddTail(id)); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowTailRemove( | ||
reStruct: ReStruct, | ||
id: number, | ||
tailId: number, | ||
) { | ||
const action = new Action(); | ||
|
||
action.addOp(new MultitailArrowRemoveTail(id, tailId)); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowHeadTailsResize( | ||
reStruct: ReStruct, | ||
id: number, | ||
ref: MultitailArrowReferencePosition, | ||
offset: number, | ||
) { | ||
const action = new Action(); | ||
action.addOp( | ||
new MultitailArrowResizeTailHead(id, offset, ref.name === 'head'), | ||
); | ||
return action.perform(reStruct); | ||
} | ||
|
||
export function fromMultitailArrowHeadTailMove( | ||
reStruct: ReStruct, | ||
id: number, | ||
ref: MultitailArrowReferencePosition, | ||
offset: number, | ||
normalize?: true, | ||
) { | ||
const action = new Action(); | ||
action.addOp( | ||
new MultitailArrowMoveHeadTail(id, offset, ref.name, ref.tailId, normalize), | ||
); | ||
return action.perform(reStruct); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/ketcher-core/src/application/editor/operations/multitailArrow/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './multitailArrowAddRemoveTail'; | ||
export * from './multitailArrowMove'; | ||
export * from './multitailArrowMoveHeadTail'; | ||
export * from './multitailArrowResizeTailHead'; | ||
export * from './multitailArrowUpsertDelete'; |
Oops, something went wrong.