Skip to content

Commit

Permalink
add new color to highlighter on picking instead of updating existing …
Browse files Browse the repository at this point in the history
…coloring, fix #419
  • Loading branch information
myrho committed Jan 11, 2024
1 parent 036a83c commit 480f2e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
8 changes: 0 additions & 8 deletions src/Update/Graph.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1636,14 +1636,6 @@ updateByMsg plugins uc msg model =
, config =
model.config
|> s_highlighter (highlights.selected /= Nothing)
, layers =
Highlighter.getSelectedColor model.highlights
|> Maybe.map
(\before ->
Layer.updateEntityColor before (Just color) model.layers
|> Layer.updateAddressColor before (Just color)
)
|> Maybe.withDefault model.layers
}
|> n

Expand Down
18 changes: 5 additions & 13 deletions src/Update/Graph/Highlighter.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ import Tuple exposing (..)

selectColor : Color -> Model -> Model
selectColor color model =
case model.selected of
Nothing ->
{ model
| highlights =
( "", color ) :: model.highlights
, selected = Just 0
}

Just i ->
{ model
| highlights =
List.Extra.updateAt i (mapSecond (always color)) model.highlights
}
{ model
| highlights =
( "", color ) :: model.highlights
, selected = Just 0
}


removeHighlight : Int -> Model -> Model
Expand Down

0 comments on commit 480f2e5

Please sign in to comment.