mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: lineThrough and underline can coexist
This commit is contained in:
parent
585c9f8753
commit
06d11a91d1
@ -204,12 +204,15 @@ class RichTextStyle {
|
|||||||
|
|
||||||
// underline or strikethrough
|
// underline or strikethrough
|
||||||
TextDecoration get textDecoration {
|
TextDecoration get textDecoration {
|
||||||
|
var decorations = [TextDecoration.none];
|
||||||
if (attributes.underline || attributes.href != null) {
|
if (attributes.underline || attributes.href != null) {
|
||||||
return TextDecoration.underline;
|
decorations.add(TextDecoration.underline);
|
||||||
} else if (attributes.strikethrough) {
|
// TextDecoration.underline;
|
||||||
return TextDecoration.lineThrough;
|
|
||||||
}
|
}
|
||||||
return TextDecoration.none;
|
if (attributes.strikethrough) {
|
||||||
|
decorations.add(TextDecoration.lineThrough);
|
||||||
|
}
|
||||||
|
return TextDecoration.combine(decorations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// font
|
// font
|
||||||
|
@ -97,11 +97,6 @@ bool formatRichTextPartialStyle(EditorState editorState, String styleKey) {
|
|||||||
Attributes attributes = {
|
Attributes attributes = {
|
||||||
styleKey: value,
|
styleKey: value,
|
||||||
};
|
};
|
||||||
if (styleKey == StyleKey.underline && value) {
|
|
||||||
attributes[StyleKey.strikethrough] = null;
|
|
||||||
} else if (styleKey == StyleKey.strikethrough && value) {
|
|
||||||
attributes[StyleKey.underline] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return formatRichTextStyle(editorState, attributes);
|
return formatRichTextStyle(editorState, attributes);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user