2537 nPixel sz sH partialCopy| |
2537 nPixel sz sH partialCopy| |
2538 |
2538 |
2539 count := nLines. |
2539 count := nLines. |
2540 sz := self size. |
2540 sz := self size. |
2541 (firstLineShown + nLines + nFullLinesShown > sz) ifTrue:[ |
2541 (firstLineShown + nLines + nFullLinesShown > sz) ifTrue:[ |
2542 count := sz - firstLineShown - nFullLinesShown + 1 |
2542 count := sz - firstLineShown - nFullLinesShown + 1 |
2543 ]. |
2543 ]. |
2544 count <= 0 ifTrue:[^ self]. |
2544 count <= 0 ifTrue:[^ self]. |
2545 |
2545 |
2546 self originWillChange. |
2546 self originWillChange. |
2547 nPixel := fontHeight * count. |
2547 nPixel := fontHeight * count. |
2548 |
2548 |
2549 shown ifFalse:[ |
2549 shown ifFalse:[ |
2550 firstLineShown := firstLineShown + count. |
2550 firstLineShown := firstLineShown + count. |
2551 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2551 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2552 ] ifTrue:[ |
2552 ] ifTrue:[ |
2553 (count >= nLinesShown) ifTrue:[ |
2553 (count >= nLinesShown) ifTrue:[ |
2554 firstLineShown := firstLineShown + count. |
2554 firstLineShown := firstLineShown + count. |
2555 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2555 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2556 self redrawFromVisibleLine:1 to:nLinesShown. |
2556 self redrawFromVisibleLine:1 to:nLinesShown. |
2557 ] ifFalse:[ |
2557 ] ifFalse:[ |
2558 m2 := margin * 2. |
2558 m2 := margin * 2. |
2559 w := self widthForScrollBetween:firstLineShown |
2559 w := self widthForScrollBetween:firstLineShown |
2560 and:(firstLineShown + nLinesShown). |
2560 and:(firstLineShown + nLinesShown). |
2561 w := w + leftMargin. |
2561 w := w + leftMargin. |
2562 |
2562 |
2563 sH := lineSpacing // 2. |
2563 sH := lineSpacing // 2. |
2564 y0 := textStartTop - sH. |
2564 y0 := textStartTop - sH. |
2565 h := nPixel + y0. |
2565 h := nPixel + y0. |
2566 n := height - h + (lineSpacing " //2 "). |
2566 n := height - h + (lineSpacing " //2 "). |
2567 |
2567 |
2568 y1 := h + n - 1. |
2568 y1 := h + n - 1. |
2569 y1 >= (height - margin) ifTrue:[ |
2569 y1 >= (height - margin) ifTrue:[ |
2570 partialCopy := true. |
2570 partialCopy := true. |
2571 y1 := height - margin - 1 |
2571 y1 := height - margin - 1 |
2572 ]. |
2572 ]. |
2573 |
2573 |
2574 self catchExpose. |
2574 self catchExpose. |
2575 self copyFrom:self x:margin y:h |
2575 self |
2576 toX:margin y:y0 |
2576 copyFrom:self x:margin y:h |
2577 width:w height:(y1 - h + 1). |
2577 toX:margin y:y0 |
2578 |
2578 width:w height:(y1 - h + 1) |
2579 firstLineShown := firstLineShown + count. |
2579 async:true. |
2580 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2580 |
2581 |
2581 firstLineShown := firstLineShown + count. |
2582 (partialCopy == true and:[lineSpacing ~~ 0]) ifTrue:[ |
2582 viewOrigin := viewOrigin x @ (viewOrigin y + nPixel). |
2583 self paint:bgColor. |
2583 |
2584 self fillRectangleX:margin y:(y0 + (y1 - h + 1)) |
2584 (partialCopy == true and:[lineSpacing ~~ 0]) ifTrue:[ |
2585 width:w height:sH. |
2585 self paint:bgColor. |
2586 ]. |
2586 self fillRectangleX:margin y:(y0 + (y1 - h + 1)) |
2587 self redrawFromVisibleLine:(nFullLinesShown - count + 1) to:nLinesShown. |
2587 width:w height:sH. |
2588 self waitForExpose. |
2588 ]. |
2589 ]. |
2589 self redrawFromVisibleLine:(nFullLinesShown - count + 1) to:nLinesShown. |
|
2590 self waitForExpose. |
|
2591 ]. |
2590 ]. |
2592 ]. |
2591 self originChanged:(0 @ nPixel). |
2593 self originChanged:(0 @ nPixel). |
2592 |
2594 |
2593 "Modified: 26.5.1996 / 15:59:29 / cg" |
2595 "Modified: 29.1.1997 / 13:30:23 / cg" |
2594 ! |
2596 ! |
2595 |
2597 |
2596 scrollDownPixels:pix |
2598 scrollDownPixels:pix |
2597 "change origin to scroll down some pixels |
2599 "change origin to scroll down some pixels |
2598 (towards the bottom of the text) |
2600 (towards the bottom of the text) |