summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 11:05:09 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-29 11:05:09 +0300
commitfb38f92c3a5c29c568575df87f0c29e777ebd969 (patch)
tree496a4077ce900e1d7b77cd7d0288220aebb8dd4e /src/gmdocument.c
parentd1db016ac75720c6a89904c9a14e6112352b5d59 (diff)
Improving alt text animation; cleaned up key shortcut labels
Remove extra Plus signs from key shortcuts.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 007311d2..7fddc575 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -421,9 +421,9 @@ static void doLayout_GmDocument_(iGmDocument *d) {
421 iGmPreMeta meta = { .bounds = line }; 421 iGmPreMeta meta = { .bounds = line };
422 meta.pixelRect.size = measurePreformattedBlock_GmDocument_( 422 meta.pixelRect.size = measurePreformattedBlock_GmDocument_(
423 d, line.start, preFont, &meta.contents, &meta.bounds.end); 423 d, line.start, preFont, &meta.contents, &meta.bounds.end);
424 if (meta.pixelRect.size.x > 424 if (meta.pixelRect.size.x > d->size.x - indents[preformatted_GmLineType] * gap_Text) {
425 d->size.x /*- indents[preformatted_GmLineType] * gap_Text*/) {
426 preFont = preformattedSmall_FontId; 425 preFont = preformattedSmall_FontId;
426 meta.pixelRect.size = measureRange_Text(preFont, meta.contents);
427 } 427 }
428 trimLine_Rangecc(&line, type, isNormalized); 428 trimLine_Rangecc(&line, type, isNormalized);
429 meta.altText = line; /* without the ``` */ 429 meta.altText = line; /* without the ``` */
@@ -1729,4 +1729,14 @@ iInt2 preRunMargin_GmDocument(const iGmDocument *d, uint16_t preId) {
1729 return init_I2(3 * gap_Text, 2 * gap_Text); 1729 return init_I2(3 * gap_Text, 2 * gap_Text);
1730} 1730}
1731 1731
1732iBool preIsFolded_GmDocument(const iGmDocument *d, uint16_t preId) {
1733 const iGmPreMeta *meta = preMeta_GmDocument(d, preId);
1734 return meta && (meta->flags & folded_GmPreMetaFlag) != 0;
1735}
1736
1737iBool preHasAltText_GmDocument(const iGmDocument *d, uint16_t preId) {
1738 const iGmPreMeta *meta = preMeta_GmDocument(d, preId);
1739 return meta && !isEmpty_Range(&meta->altText);
1740}
1741
1732iDefineClass(GmDocument) 1742iDefineClass(GmDocument)