File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ import TestAString from "../features/TestAString";
3838import { TestAStringProps } from "../features/props/TestAStringProps" ;
3939import { IsDFA } from "../utils/IsDFA" ;
4040import { IsNFA } from "../utils/IsNFA" ;
41- import { transitionSelectedColor } from "../consts/Colors" ;
41+ import { transitionColor , transitionSelectedColor } from "../consts/Colors" ;
4242import {
4343 StateDefaultSize ,
4444 StateMaxSize ,
@@ -157,6 +157,9 @@ export const Editor = () => {
157157 stateY : 0 ,
158158 } ) ;
159159
160+ const [ areTransitionsBeingHighlighted , setAreTransitionsBeingHighlighted ] =
161+ useState ( false ) ;
162+
160163 const handleAddRow = ( row : RowModel ) => {
161164 if ( states . length >= MaxNumberOfStates ) {
162165 setAlertMessage ( `Maximum ${ MaxNumberOfStates } states allowed.` ) ;
@@ -546,16 +549,21 @@ export const Editor = () => {
546549 if ( t . value . includes ( "^" ) ) {
547550 return {
548551 ...t ,
549- color : transitionSelectedColor ,
550- dashness : {
551- animation : 1 ,
552- } ,
552+ color : areTransitionsBeingHighlighted
553+ ? transitionColor
554+ : transitionSelectedColor ,
555+ dashness : areTransitionsBeingHighlighted
556+ ? false
557+ : {
558+ animation : 1 ,
559+ } ,
553560 } ;
554561 }
555562 return t ;
556563 } )
557564 ) ;
558565
566+ setAreTransitionsBeingHighlighted ( ( v ) => ! v ) ;
559567 setToolSelected ( null ) ;
560568 } ;
561569
You can’t perform that action at this time.
0 commit comments