summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index cde6f4c9..d49cccd9 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -166,7 +166,7 @@ static iInt2 measurePreformattedBlock_GmDocument_(const iGmDocument *d, const ch
166 } 166 }
167 contents->end = line.end; 167 contents->end = line.end;
168 } 168 }
169 return measureRange_Text(font, *contents); 169 return measureRange_Text(font, *contents).bounds.size;
170} 170}
171 171
172static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) { 172static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *linkId) {
@@ -483,7 +483,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
483 if (meta.pixelRect.size.x > 483 if (meta.pixelRect.size.x >
484 d->size.x - (enableIndents ? indents[preformatted_GmLineType] : 0) * gap_Text) { 484 d->size.x - (enableIndents ? indents[preformatted_GmLineType] : 0) * gap_Text) {
485 preFont = preformattedSmall_FontId; 485 preFont = preformattedSmall_FontId;
486 meta.pixelRect.size = measureRange_Text(preFont, meta.contents); 486 meta.pixelRect.size = measureRange_Text(preFont, meta.contents).bounds.size;
487 } 487 }
488 trimLine_Rangecc(&line, type, isNormalized); 488 trimLine_Rangecc(&line, type, isNormalized);
489 meta.altText = line; /* without the ``` */ 489 meta.altText = line; /* without the ``` */
@@ -614,8 +614,8 @@ static void doLayout_GmDocument_(iGmDocument *d) {
614 altText.color = tmQuote_ColorId; 614 altText.color = tmQuote_ColorId;
615 altText.text = isBlank ? range_Lang(range_CStr("doc.pre.nocaption")) 615 altText.text = isBlank ? range_Lang(range_CStr("doc.pre.nocaption"))
616 : meta->altText; 616 : meta->altText;
617 iInt2 size = advanceWrapRange_Text(altText.font, d->size.x - 2 * margin.x, 617 iInt2 size = measureWrapRange_Text(altText.font, d->size.x - 2 * margin.x,
618 altText.text); 618 altText.text).bounds.size;
619 altText.bounds = altText.visBounds = init_Rect(pos.x, pos.y, d->size.x, 619 altText.bounds = altText.visBounds = init_Rect(pos.x, pos.y, d->size.x,
620 size.y + 2 * margin.y); 620 size.y + 2 * margin.y);
621 altText.preId = preId; 621 altText.preId = preId;
@@ -661,7 +661,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
661 quoteRun.text = range_CStr(quote); 661 quoteRun.text = range_CStr(quote);
662 quoteRun.color = tmQuoteIcon_ColorId; 662 quoteRun.color = tmQuoteIcon_ColorId;
663 iRect vis = visualBounds_Text(quoteRun.font, quoteRun.text); 663 iRect vis = visualBounds_Text(quoteRun.font, quoteRun.text);
664 quoteRun.visBounds.size = advance_Text(quoteRun.font, quote); 664 quoteRun.visBounds.size = measure_Text(quoteRun.font, quote).bounds.size;
665 quoteRun.visBounds.pos = 665 quoteRun.visBounds.pos =
666 add_I2(pos, 666 add_I2(pos,
667 init_I2((indents[quote_GmLineType] - 5) * gap_Text, 667 init_I2((indents[quote_GmLineType] - 5) * gap_Text,