Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
8fea2846
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8fea2846
编写于
7月 21, 2020
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(label): support legacy style color: 'auto' for color: 'inherit' usage.
Not breaking the exists code.
上级
41ba1573
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
10 deletion
+40
-10
src/chart/gauge/GaugeView.ts
src/chart/gauge/GaugeView.ts
+3
-1
src/label/labelStyle.ts
src/label/labelStyle.ts
+37
-9
未找到文件。
src/chart/gauge/GaugeView.ts
浏览文件 @
8fea2846
...
...
@@ -264,7 +264,9 @@ class GaugeView extends ChartView {
y
:
unitY
*
(
r
-
splitLineLen
-
distance
)
+
cy
,
verticalAlign
:
unitY
<
-
0.4
?
'
top
'
:
(
unitY
>
0.4
?
'
bottom
'
:
'
middle
'
),
align
:
unitX
<
-
0.4
?
'
left
'
:
(
unitX
>
0.4
?
'
right
'
:
'
center
'
)
},
{
inheritColor
:
autoColor
}),
},
{
inheritColor
:
autoColor
}),
silent
:
true
}));
}
...
...
src/label/labelStyle.ts
浏览文件 @
8fea2846
...
...
@@ -16,6 +16,8 @@ import {
import
GlobalModel
from
'
../model/Global
'
;
import
{
isFunction
,
retrieve2
,
extend
,
keys
,
trim
}
from
'
zrender/src/core/util
'
;
import
{
SPECIAL_STATES
,
DISPLAY_STATES
}
from
'
../util/states
'
;
import
{
__DEV__
}
from
'
../config
'
;
import
{
deprecateReplaceLog
}
from
'
../util/log
'
;
type
TextCommonParams
=
{
/**
...
...
@@ -30,6 +32,11 @@ type TextCommonParams = {
defaultOutsidePosition
?:
LabelOption
[
'
position
'
]
/**
* If support legacy 'auto' for 'inherit' usage.
*/
// supportLegacyAuto?: boolean
textStyle
?:
ZRStyleProps
};
const
EMPTY_OBJ
=
{};
...
...
@@ -406,7 +413,12 @@ function setTokenTextStyle(
const
inheritColor
=
opt
&&
opt
.
inheritColor
;
let
fillColor
=
textStyleModel
.
getShallow
(
'
color
'
);
let
strokeColor
=
textStyleModel
.
getShallow
(
'
textBorderColor
'
);
if
(
fillColor
===
'
inherit
'
)
{
if
(
fillColor
===
'
inherit
'
||
fillColor
===
'
auto
'
)
{
if
(
__DEV__
)
{
if
(
fillColor
===
'
auto
'
)
{
deprecateReplaceLog
(
'
color:
\'
auto
\'
'
,
'
color:
\'
inherit
\'
'
);
}
}
if
(
inheritColor
)
{
fillColor
=
inheritColor
;
}
...
...
@@ -414,12 +426,17 @@ function setTokenTextStyle(
fillColor
=
null
;
}
}
if
(
strokeColor
===
'
inherit
'
&&
inheritColor
)
{
if
(
strokeColor
===
'
inherit
'
||
(
strokeColor
===
'
auto
'
))
{
if
(
__DEV__
)
{
if
(
strokeColor
===
'
auto
'
)
{
deprecateReplaceLog
(
'
color:
\'
auto
\'
'
,
'
color:
\'
inherit
\'
'
);
}
}
if
(
inheritColor
)
{
strokeColor
=
inheritColor
;
}
else
{
strokeColor
=
inheritColor
;
strokeColor
=
null
;
}
}
fillColor
=
fillColor
||
globalTextStyle
.
color
;
...
...
@@ -465,12 +482,6 @@ function setTokenTextStyle(
}
}
if
(
!
isBlock
||
!
opt
.
disableBox
)
{
if
(
textStyle
.
backgroundColor
===
'
auto
'
&&
inheritColor
)
{
textStyle
.
backgroundColor
=
inheritColor
;
}
if
(
textStyle
.
borderColor
===
'
auto
'
&&
inheritColor
)
{
textStyle
.
borderColor
=
inheritColor
;
}
for
(
let
i
=
0
;
i
<
TEXT_PROPS_BOX
.
length
;
i
++
)
{
const
key
=
TEXT_PROPS_BOX
[
i
];
const
val
=
textStyleModel
.
getShallow
(
key
);
...
...
@@ -478,6 +489,23 @@ function setTokenTextStyle(
(
textStyle
as
any
)[
key
]
=
val
;
}
}
if
((
textStyle
.
backgroundColor
===
'
auto
'
||
textStyle
.
backgroundColor
===
'
inherit
'
)
&&
inheritColor
)
{
if
(
__DEV__
)
{
if
(
textStyle
.
backgroundColor
===
'
auto
'
)
{
deprecateReplaceLog
(
'
backgroundColor:
\'
auto
\'
'
,
'
backgroundColor:
\'
inherit
\'
'
);
}
}
textStyle
.
backgroundColor
=
inheritColor
;
}
if
((
textStyle
.
borderColor
===
'
auto
'
||
textStyle
.
borderColor
===
'
inherit
'
)
&&
inheritColor
)
{
if
(
__DEV__
)
{
if
(
textStyle
.
borderColor
===
'
auto
'
)
{
deprecateReplaceLog
(
'
borderColor:
\'
auto
\'
'
,
'
borderColor:
\'
inherit
\'
'
);
}
}
textStyle
.
borderColor
=
inheritColor
;
}
}
}
export
function
getFont
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录