File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## 1.0.4+1
2
+ - fix: vertex text style ` background ` not working.
3
+
1
4
## 1.0.4
2
5
- feat: support specifying vertex text style.
3
6
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ class VertexTextRendererImpl extends VertexTextRenderer {
21
21
var paragraphFontSize = vertexTextStyle? .fontSize ?? 14 ;
22
22
var fontWeight = vertexTextStyle? .fontWeight ?? FontWeight .normal;
23
23
var fontColor = vertexTextStyle? .color;
24
+ var backgroundColor = vertexTextStyle? .backgroundColor;
24
25
25
26
/// 1.生成 ParagraphStyle,可设置文本的基本信息
26
27
final paragraphStyle = ui.ParagraphStyle (
@@ -39,6 +40,8 @@ class VertexTextRendererImpl extends VertexTextRenderer {
39
40
fontSize: fontSize,
40
41
foreground: fontColor != null ? (Paint ()..color = fontColor) : paint,
41
42
fontWeight: fontWeight,
43
+ background:
44
+ backgroundColor == null ? null : (Paint ()..color = backgroundColor),
42
45
);
43
46
44
47
/// 3.添加样式和文字
@@ -52,7 +55,8 @@ class VertexTextRendererImpl extends VertexTextRenderer {
52
55
TextPainter hpainter = TextPainter (
53
56
textDirection: TextDirection .ltr,
54
57
text: TextSpan (
55
- style: const TextStyle (fontSize: 16 ),
58
+ style:
59
+ TextStyle (fontSize: paragraphFontSize + 2 , fontWeight: fontWeight),
56
60
text: text,
57
61
),
58
62
)..layout ();
Original file line number Diff line number Diff line change 1
1
name : flutter_graph_view
2
2
description : Widgets for beautiful graphic data structures, such as force-oriented diagrams.
3
- version : 1.0.4
3
+ version : 1.0.4+1
4
4
repository : https://github.com/dudu-ltd/flutter_graph_view
5
5
homepage : https://graph-cn.github.io/flutter_graph_view
6
6
You can’t perform that action at this time.
0 commit comments