改进SVG的ToolTips

This commit is contained in:
codeboss 2025-04-13 00:15:23 +08:00
parent 06e1b5553a
commit e18f45dba5
3 changed files with 5 additions and 2 deletions

View File

@ -111,6 +111,8 @@ open System.Linq
override this.members(): AstObject list = objs
override this.address (): string =
bind.GetAttribute "address"
override this.filePath (): string =
bind.GetAttribute "file-path"
static member GenerateFromChildSibling(child: XmlNode): SliceChildType list =
match child with

View File

@ -951,11 +951,11 @@ open System.IO
// 线
let story_decl = story_lines|> List.map(fun story ->
$"""node_{story.address()}[label="{story.name()}" shape="cds"]
$"""node_{story.address()}[label="{story.name()}" shape="cds" tooltip="{story.filePath()}"]
""")|> List.reduce(fun a b -> a + b)
//
let points_decl = fragment_defs |> List.map(fun (_, node_def) ->
$"""node_{node_def.address()}[label="{node_def.name()}" shape="rect"]
$"""node_{node_def.address()}[label="{node_def.name()}" shape="rect" tooltip="{node_def.filePath()}"]
""")|> List.reduce(fun a b -> a + b)
//
let nodes_decl = story_decl + points_decl

View File

@ -86,6 +86,7 @@ bool printer::AstGenerate::visit(std::shared_ptr<const ast_gen::ElementAccess> s
dom_slice.setAttribute("name", slice_node->name());
dom_slice.setAttribute("address", (qulonglong) slice_node.get());
dom_slice.setAttribute("file-path", src_root.relativeFilePath(slice_node->filePath()));
append_tokens(dom_slice, slice_node);
}break;