mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-09-11 19:17:43 +03: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 headingPaddings = pageStyle.lineHeightLayout.headingPaddings
|
||||
.map((e) => e * factor);
|
||||
final level = node.attributes[HeadingBlockKeys.level] ?? 6;
|
||||
return EdgeInsets.only(top: headingPaddings.elementAt(level));
|
||||
int level = node.attributes[HeadingBlockKeys.level] ?? 6;
|
||||
level = level.clamp(1, 6);
|
||||
return EdgeInsets.only(top: headingPaddings.elementAt(level - 1));
|
||||
}
|
||||
|
||||
return const EdgeInsets.only(top: 12.0, bottom: 4.0);
|
||||
|
Loading…
Reference in New Issue
Block a user