-
Notifications
You must be signed in to change notification settings - Fork 195
QOL: Arrow bending and termination #3717
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
Closed
Closed
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
24cf03e
feat: colour-coding arrows
b0cccb0
feat: removed colour-coding for arrows (all white), implemented featu…
151c4e8
fix: removed whitespace
1a2a294
Merge branch 'source-academy:master' into master
cd9ec5b
fix: bugfix and linting
a6ffa89
test
RogerZhang888 4cde278
Merge branch 'master' into master
b9c62d8
test2
RogerZhang888 8675d11
Merge branch 'master' of https://github.com/wjh3355/source-frontend-fork
RogerZhang888 1de724b
fix: Refactor arrow selection management and clean up code style
7cf2e8c
fix: ran linter
1b15c73
fix: snapshots
889b5d0
fix: change to american english for the word "color"
4055da7
fix: faded arrows now stay faded
0fccc0c
Merge remote-tracking branch 'upstream/master'
1856ae7
test
RogerZhang888 e14db30
test
RogerZhang888 5770e18
test
RogerZhang888 99f360b
fix: prematurely terminating arrows
RogerZhang888 50225ce
added global MinTerminalSegmentLength
RogerZhang888 99bc4ed
fix start
RogerZhang888 6b93490
added arrows from function objects to their body; added filter for di…
d81af57
Merge branch 'master' of github.com:wjh3355/source-frontend-fork
03f4382
made arrows highlight to red in printable mode; added more filters fo…
2613f9d
standardardised radius of curvature for arrows
RogerZhang888 aaf878c
Merge remote-tracking branch 'upstream/master' into rz
RogerZhang888 43dbdaf
QOL: improved arrow bending
RogerZhang888 1cdf263
Merge remote-tracking branch 'upstream' into rz
RogerZhang888 9e78919
updates
RogerZhang888 107a5cc
update
RogerZhang888 3053b33
update
RogerZhang888 76bd08f
update
RogerZhang888 0b2b815
update
RogerZhang888 5379d48
update
RogerZhang888 45d8428
update
RogerZhang888 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
35 changes: 35 additions & 0 deletions
35
src/features/cseMachine/components/arrows/ArrowFromFnToBody.ts
This file contains hidden or 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,35 @@ | ||
| import { Config } from '../../CseMachineConfig'; | ||
| import { StepsArray } from '../../CseMachineTypes'; | ||
| import { FnValue } from '../values/FnValue'; | ||
| import { GlobalFnValue } from '../values/GlobalFnValue'; | ||
| import { FnBodyTarget } from './FnBodyTarget'; | ||
| import { GenericArrow } from './GenericArrow'; | ||
|
|
||
| /** Arrow from first function circle to its description tooltip. */ | ||
| export class ArrowFromFnToBody extends GenericArrow<FnValue | GlobalFnValue, FnBodyTarget> { | ||
| constructor(from: FnValue | GlobalFnValue) { | ||
| super(from); | ||
| this.isLive = from instanceof GlobalFnValue ? true : from.isLive(); | ||
| } | ||
|
|
||
| protected updateIsLive(): void { | ||
| this.isLive = this.source instanceof GlobalFnValue ? true : this.source.isLive(); | ||
| } | ||
|
|
||
| protected isInteractive(): boolean { | ||
| return false; | ||
| } | ||
|
|
||
| protected getOriginFilterKey() { | ||
| return 'function' as const; | ||
| } | ||
|
|
||
| protected calculateSteps(): StepsArray { | ||
| const to = this.target; | ||
| if (!to) return []; | ||
|
|
||
| const targetY = to.y(); | ||
|
|
||
| return [(x, y) => [x + Config.FnRadius, y], (x, _y) => [x, targetY]]; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Using
anyforparentFramebypasses TypeScript's type checking. Since this property is used to access coordinates and dimensions (e.g., inArrowFromText.tsx), it should be typed asIVisibleorFrameto ensure type safety.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.
@RichDom2185 has also advised me in another of my recent PRs to not use the 'any' type in general. The exact comment with his message is here.
#3690 (comment)
It might be outdated! Do expand the "outdated" comment tabs