Opam_graph: UI: Played around with hitbox for layer2 deps to fix firefox hover-hitbox - firefox seems broken vs chromium

This commit is contained in:
rand00 2022-01-19 17:43:44 +01:00
parent 9c6d140c43
commit 0a875c2e35

View file

@ -275,6 +275,10 @@ line {
transform: scale(2); transform: scale(2);
} }
.layer2_dep.node:hover {
transform: scale(1.4);
}
|} |}
(* disabled CSS (* disabled CSS
@ -327,7 +331,7 @@ line {
] [] ] []
] ]
let make_rect ~center_pos ~width = let make_square ~center_pos ~width =
let open Gg in let open Gg in
let center_pos = V2.v center_pos.x center_pos.y in let center_pos = V2.v center_pos.x center_pos.y in
let diagonal = V2.v width width in let diagonal = V2.v width width in
@ -336,7 +340,7 @@ line {
Svg.[ Svg.[
rect ~a:[ rect ~a:[
(* a_stroke @@ `Color ("black", None); (* a_stroke @@ `Color ("black", None);
* a_stroke_width @@ Unit.none 0.001; *) * a_stroke_width @@ Unit.none 0.001; *)
a_fill @@ `Color ("rgba(0,0,0,0)", None); (*goto control with css*) a_fill @@ `Color ("rgba(0,0,0,0)", None); (*goto control with css*)
a_x @@ Unit.none @@ V2.x pos; a_x @@ Unit.none @@ V2.x pos;
a_y @@ Unit.none @@ V2.y pos; a_y @@ Unit.none @@ V2.y pos;
@ -390,9 +394,17 @@ line {
.direct_dep.node.%s:hover ~ .layer2_deps.bg.%s { .direct_dep.node.%s:hover ~ .layer2_deps.bg.%s {
fill: dimgrey; fill: dimgrey;
} }
|} dep dep dep dep dep dep |} dep dep dep dep dep dep
(*< goto move generation of node-css to some other place*) (*< goto move generation of node-css to some other place*)
(*disabled css:
(*> problem: selected other following children as well*)
.layer2_dep.hitbox.%s:hover ~ .layer2_dep.node.%s {
transform: scale(1.4);
}
*)
let make_triangle ~top ~left ~right = let make_triangle ~top ~left ~right =
let a = Svg.[ let a = Svg.[
a_points [ a_points [
@ -533,7 +545,7 @@ line {
a_class ("hitbox" :: classes); a_class ("hitbox" :: classes);
a_transform_origin @@ sprintf "%f %f" center_pos.x center_pos.y; a_transform_origin @@ sprintf "%f %f" center_pos.x center_pos.y;
] in ] in
Svg.g ~a (title :: make_rect ~center_pos ~width) Svg.g ~a (title :: make_square ~center_pos ~width)
let make_layer2_nodes_grid ~layer2_deps ~layer2_deps_center = let make_layer2_nodes_grid ~layer2_deps ~layer2_deps_center =
let open Gg in let open Gg in
@ -550,7 +562,7 @@ line {
make_hitbox_square ~text ~classes make_hitbox_square ~text ~classes
~center_pos:pos ~center_pos:pos
~width:cell_width in ~width:cell_width in
[ visual_svg; hitbox_svg ] [ (* hitbox_svg; *)visual_svg ]
) )
|> List.flatten |> List.flatten