Skip to content

Commit

Permalink
cursor: do not call invalidateVisual when configuring
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Oct 22, 2020
1 parent 4b35fc9 commit b99586d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Views/Cursor.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type Cursor() as this =
(* reconfigure the cursor *)
showCursor true
cursorTimerRun blinkon this.ViewModel.blinkwait
this.InvalidateVisual()
// this.InvalidateVisual()

let setCursorAnimation() =
let transitions = Transitions()
Expand All @@ -113,17 +113,16 @@ type Cursor() as this =
transitions.Add(y_transition)
trace "cursor" "setCursorAnimation: blink=%b, move=%b" States.cursor_smoothblink States.cursor_smoothmove
this.Transitions <- transitions
this.Transitions |> ignore
()

do
this.Watch [
this.OnRenderTick cursorConfig
this.GetObservable(IsActiveProperty)
|> Observable.subscribe(fun v ->
|> Observable.subscribe(fun _ ->
setCursorAnimation()
this.InvalidateVisual())
States.Register.Watch "cursor" setCursorAnimation

]
AvaloniaXamlLoader.Load(this)

Expand Down

0 comments on commit b99586d

Please sign in to comment.