改进SVG的ToolTips
This commit is contained in:
parent
06e1b5553a
commit
e18f45dba5
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue