summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:42:23 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-09 10:42:23 +0200
commit0585c687a38f0d177ec4db48567ea08326094111 (patch)
treeba1feafdda3a1258f7baa18edbe7eeaf97ff5bd8 /src/gmdocument.c
parent59363d3e230a0e9702e31936309473fb576ecec5 (diff)
parent4ae755de3ff4a37763aacc22ea119edab2099e84 (diff)
Merge branch 'dev' into work/v1.11
# Conflicts: # res/lang/eo.bin # res/lang/ie.bin
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 69fe77f8..546dc6f5 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -316,7 +316,8 @@ static iBool isAllowedLinkIcon_Char_(iChar icon) {
316 icon == 0x2022 /* bullet */ || 316 icon == 0x2022 /* bullet */ ||
317 icon == 0x2139 /* info */ || 317 icon == 0x2139 /* info */ ||
318 (icon >= 0x2190 && icon <= 0x21ff /* arrows */) || 318 (icon >= 0x2190 && icon <= 0x21ff /* arrows */) ||
319 icon == 0x2a2f /* close X */ || icon == 0x2b50; 319 icon == 0x2a2f /* close X */ ||
320 (icon >= 0x2b00 && icon <= 0x2bff);
320} 321}
321 322
322static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) { 323static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) {
@@ -1097,7 +1098,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
1097 /* Image metadata caption. */ { 1098 /* Image metadata caption. */ {
1098 run.font = FONT_ID(documentBody_FontId, semiBold_FontStyle, contentSmall_FontSize); 1099 run.font = FONT_ID(documentBody_FontId, semiBold_FontStyle, contentSmall_FontSize);
1099 run.color = tmQuoteIcon_ColorId; 1100 run.color = tmQuoteIcon_ColorId;
1100 run.flags = decoration_GmRunFlag; 1101 run.flags = decoration_GmRunFlag | caption_GmRunFlag;
1101 run.mediaId = 0; 1102 run.mediaId = 0;
1102 run.mediaType = 0; 1103 run.mediaType = 0;
1103 run.visBounds.pos.y = pos.y; 1104 run.visBounds.pos.y = pos.y;
@@ -2212,7 +2213,7 @@ const iGmRun *renderProgressive_GmDocument(const iGmDocument *d, const iGmRun *f
2212 setAnsiFlags_Text(d->theme.ansiEscapes); 2213 setAnsiFlags_Text(d->theme.ansiEscapes);
2213 const iGmRun *run = first; 2214 const iGmRun *run = first;
2214 while (isValidRun_GmDocument_(d, run)) { 2215 while (isValidRun_GmDocument_(d, run)) {
2215 if ((dir < 0 && bottom_Rect(run->visBounds) < visRangeY.start) || 2216 if ((dir < 0 && bottom_Rect(run->visBounds) <= visRangeY.start) ||
2216 (dir > 0 && top_Rect(run->visBounds) >= visRangeY.end)) { 2217 (dir > 0 && top_Rect(run->visBounds) >= visRangeY.end)) {
2217 break; 2218 break;
2218 } 2219 }
@@ -2263,6 +2264,10 @@ const iString *source_GmDocument(const iGmDocument *d) {
2263 return &d->source; 2264 return &d->source;
2264} 2265}
2265 2266
2267iGmRunRange runRange_GmDocument(const iGmDocument *d) {
2268 return (iGmRunRange){ constFront_Array(&d->layout), constEnd_Array(&d->layout) };
2269}
2270
2266size_t memorySize_GmDocument(const iGmDocument *d) { 2271size_t memorySize_GmDocument(const iGmDocument *d) {
2267 return size_String(&d->unormSource) + 2272 return size_String(&d->unormSource) +
2268 size_String(&d->source) + 2273 size_String(&d->source) +