diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index fd7804fa..2f3a006f 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -64,7 +64,6 @@ struct Impl_GmDocument { | |||
64 | iString source; | 64 | iString source; |
65 | iString url; /* for resolving relative links */ | 65 | iString url; /* for resolving relative links */ |
66 | iString localHost; | 66 | iString localHost; |
67 | int forceBreakWidth; /* force breaks on very long preformatted lines */ | ||
68 | iBool siteBannerEnabled; | 67 | iBool siteBannerEnabled; |
69 | iInt2 size; | 68 | iInt2 size; |
70 | iArray layout; /* contents of source, laid out in document space */ | 69 | iArray layout; /* contents of source, laid out in document space */ |
@@ -510,7 +509,7 @@ static void doLayout_GmDocument_(iGmDocument *d) { | |||
510 | } | 509 | } |
511 | run.bounds.pos = addX_I2(pos, indent * gap_Text); | 510 | run.bounds.pos = addX_I2(pos, indent * gap_Text); |
512 | const char *contPos; | 511 | const char *contPos; |
513 | const int avail = (isPreformat ? d->forceBreakWidth : d->size.x) - run.bounds.pos.x; | 512 | const int avail = d->size.x - run.bounds.pos.x; |
514 | const iInt2 dims = tryAdvance_Text(run.font, runLine, avail, &contPos); | 513 | const iInt2 dims = tryAdvance_Text(run.font, runLine, avail, &contPos); |
515 | run.bounds.size.x = iMax(avail, dims.x); /* Extends to the right edge for selection. */ | 514 | run.bounds.size.x = iMax(avail, dims.x); /* Extends to the right edge for selection. */ |
516 | run.bounds.size.y = dims.y; | 515 | run.bounds.size.y = dims.y; |
@@ -1073,8 +1072,7 @@ void setSiteBannerEnabled_GmDocument(iGmDocument *d, iBool siteBannerEnabled) { | |||
1073 | d->siteBannerEnabled = siteBannerEnabled; | 1072 | d->siteBannerEnabled = siteBannerEnabled; |
1074 | } | 1073 | } |
1075 | 1074 | ||
1076 | void setWidth_GmDocument(iGmDocument *d, int width, int forceBreakWidth) { | 1075 | void setWidth_GmDocument(iGmDocument *d, int width) { |
1077 | d->forceBreakWidth = forceBreakWidth; | ||
1078 | d->size.x = width; | 1076 | d->size.x = width; |
1079 | doLayout_GmDocument_(d); /* TODO: just flag need-layout and do it later */ | 1077 | doLayout_GmDocument_(d); /* TODO: just flag need-layout and do it later */ |
1080 | } | 1078 | } |
@@ -1159,10 +1157,10 @@ void setUrl_GmDocument(iGmDocument *d, const iString *url) { | |||
1159 | setRange_String(&d->localHost, parts.host); | 1157 | setRange_String(&d->localHost, parts.host); |
1160 | } | 1158 | } |
1161 | 1159 | ||
1162 | void setSource_GmDocument(iGmDocument *d, const iString *source, int width, int forceBreakWidth) { | 1160 | void setSource_GmDocument(iGmDocument *d, const iString *source, int width) { |
1163 | set_String(&d->source, source); | 1161 | set_String(&d->source, source); |
1164 | normalize_GmDocument(d); | 1162 | normalize_GmDocument(d); |
1165 | setWidth_GmDocument(d, width, forceBreakWidth); /* re-do layout */ | 1163 | setWidth_GmDocument(d, width); /* re-do layout */ |
1166 | } | 1164 | } |
1167 | 1165 | ||
1168 | void render_GmDocument(const iGmDocument *d, iRangei visRangeY, iGmDocumentRenderFunc render, | 1166 | void render_GmDocument(const iGmDocument *d, iRangei visRangeY, iGmDocumentRenderFunc render, |