diff options
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 703d1d13..a89eb0eb 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1054,9 +1054,12 @@ static void documentWasChanged_DocumentWidget_(iDocumentWidget *d) { | |||
1054 | 1054 | ||
1055 | void setSource_DocumentWidget(iDocumentWidget *d, const iString *source) { | 1055 | void setSource_DocumentWidget(iDocumentWidget *d, const iString *source) { |
1056 | setUrl_GmDocument(d->doc, d->mod.url); | 1056 | setUrl_GmDocument(d->doc, d->mod.url); |
1057 | const int docWidth = documentWidth_DocumentWidget_(d); | ||
1058 | const int outsideMargin = (width_Widget(d) - docWidth) / 2; | ||
1057 | setSource_GmDocument(d->doc, | 1059 | setSource_GmDocument(d->doc, |
1058 | source, | 1060 | source, |
1059 | documentWidth_DocumentWidget_(d), | 1061 | docWidth, |
1062 | outsideMargin, | ||
1060 | isFinished_GmRequest(d->request) ? final_GmDocumentUpdate | 1063 | isFinished_GmRequest(d->request) ? final_GmDocumentUpdate |
1061 | : partial_GmDocumentUpdate); | 1064 | : partial_GmDocumentUpdate); |
1062 | documentWasChanged_DocumentWidget_(d); | 1065 | documentWasChanged_DocumentWidget_(d); |
@@ -2249,7 +2252,7 @@ static iBool updateDocumentWidthRetainingScrollPosition_DocumentWidget_(iDocumen | |||
2249 | /* TODO: First *fully* visible run? */ | 2252 | /* TODO: First *fully* visible run? */ |
2250 | voffset = visibleRange_DocumentWidget_(d).start - top_Rect(run->visBounds); | 2253 | voffset = visibleRange_DocumentWidget_(d).start - top_Rect(run->visBounds); |
2251 | } | 2254 | } |
2252 | setWidth_GmDocument(d->doc, newWidth); | 2255 | setWidth_GmDocument(d->doc, newWidth, (width_Widget(d) - newWidth) / 2); |
2253 | documentRunsInvalidated_DocumentWidget_(d); | 2256 | documentRunsInvalidated_DocumentWidget_(d); |
2254 | if (runLoc && !keepCenter) { | 2257 | if (runLoc && !keepCenter) { |
2255 | run = findRunAtLoc_GmDocument(d->doc, runLoc); | 2258 | run = findRunAtLoc_GmDocument(d->doc, runLoc); |