-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(IText): Swap flashing Rate of Editing Cursor for better feedback #9823
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
facb18b
b9c9be3
58cd659
81790e3
90af573
c73cf73
2b33b1a
69c753a
a837258
facd6a5
94ac362
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 |
|---|---|---|
|
|
@@ -145,21 +145,26 @@ export abstract class ITextBehavior< | |
| }); | ||
| } | ||
|
|
||
| /** | ||
| * changes the cursor from visible to invisible | ||
| */ | ||
| private _tick(delay?: number) { | ||
| this._currentTickState = this._animateCursor({ | ||
| toValue: 1, | ||
| duration: this.cursorDuration, | ||
| delay, | ||
| toValue: 0, | ||
| duration: this.cursorDuration / 2, | ||
| delay: Math.max(delay || 0, 100), | ||
| onComplete: this._onTickComplete, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel strongly against recursive/looping methods calling each other.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Therefore, I suggest to make it a single function accepting a boolean flagging the state
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just open an issue with label enanchement, the first one that can do it will do it if there is a real improvement of some kind, i can't see one that make me jump at it. The issue with not having 2 methods is that you have to use that boolean to determine the 3 conditions every time you call the single method and you don't have a single place where to determine the first delay ( delay || 100 ) so it will be harder to track which is the start of the animation.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have other questions on this code more than the double methods:
but also those are out of scope for the animation timing tweak
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here is a tracking issue #9835 |
||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Changes the cursor from invisible to visible | ||
| */ | ||
| private _onTickComplete() { | ||
| this._currentTickCompleteState?.abort(); | ||
| this._currentTickCompleteState = this._animateCursor({ | ||
| toValue: 0, | ||
| duration: this.cursorDuration / 2, | ||
| delay: 100, | ||
| toValue: 1, | ||
| duration: this.cursorDuration, | ||
| onComplete: this._tick, | ||
| }); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.