Skip to content

Commit ee9aa2f

Browse files
caolanmeszkadev
authored andcommitted
scroll: run panBy sync from drawSections
- reverted code from commit 623e2f5 "Scroll Section: Move move event into layouting tasks." It even mention: This will change in the future but for now, move event modifies map css prpoerty. - fixes regression after commit 5a672a7 "canvas: flush LayoutingService before canvas render" - makes order of processing again good for current frame: Original order (draw -> flush): 1. drawSections() - ScrollSection queues panBy 2. flushLayoutingTasks() - runs panBy synchronously Currently we flush tasks first, then will execute doMove() in ScrollSection which appends new task Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com> Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: I59937a918ef3a54c540a0c7a554720d9dea6c030
1 parent c85fb0f commit ee9aa2f

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

browser/src/canvas/sections/ScrollSection.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -338,16 +338,14 @@ export class ScrollSection extends CanvasSectionObject {
338338
private doMove() {
339339
const scrollProps: ScrollProperties = (app.activeDocument as DocumentBase).activeLayout.scrollProperties;
340340

341-
app.layoutingService.appendLayoutingTask(() => {
342-
this.map.panBy(new cool.Point(scrollProps.moveBy[0] / app.dpiScale, scrollProps.moveBy[1] / app.dpiScale));
343-
scrollProps.moveBy = null;
344-
this.onUpdateScrollOffset();
341+
this.map.panBy(new cool.Point(scrollProps.moveBy[0] / app.dpiScale, scrollProps.moveBy[1] / app.dpiScale));
342+
scrollProps.moveBy = null;
343+
this.onUpdateScrollOffset();
345344

346-
if (app && app.file.fileBasedView === true)
347-
app.map._docLayer._checkSelectedPart();
345+
if (app && app.file.fileBasedView === true)
346+
app.map._docLayer._checkSelectedPart();
348347

349-
app.activeDocument.activeLayout.refreshScrollProperties();
350-
});
348+
app.activeDocument.activeLayout.refreshScrollProperties();
351349
}
352350

353351
public onDraw(frameCount: number, elapsedTime: number): void {

0 commit comments

Comments
 (0)