mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: range error raise if heading level >= 6 (#5373)
This commit is contained in:
parent
d303d5affd
commit
c67e266174
@ -92,8 +92,9 @@ Map<String, BlockComponentBuilder> getEditorBuilderMap({
|
|||||||
final factor = pageStyle.fontLayout.factor;
|
final factor = pageStyle.fontLayout.factor;
|
||||||
final headingPaddings = pageStyle.lineHeightLayout.headingPaddings
|
final headingPaddings = pageStyle.lineHeightLayout.headingPaddings
|
||||||
.map((e) => e * factor);
|
.map((e) => e * factor);
|
||||||
final level = node.attributes[HeadingBlockKeys.level] ?? 6;
|
int level = node.attributes[HeadingBlockKeys.level] ?? 6;
|
||||||
return EdgeInsets.only(top: headingPaddings.elementAt(level));
|
level = level.clamp(1, 6);
|
||||||
|
return EdgeInsets.only(top: headingPaddings.elementAt(level - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
return const EdgeInsets.only(top: 12.0, bottom: 4.0);
|
return const EdgeInsets.only(top: 12.0, bottom: 4.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user