Skip to content

Commit 3a0cdc0

Browse files
committed
fix code for dirty rectangles
1 parent a6aa6d2 commit 3a0cdc0

File tree

13 files changed

+196
-182
lines changed

13 files changed

+196
-182
lines changed

src/Roassal-Animation/RSTransitionAnimation.class.st

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ c
107107

108108
self onStepDo: [ :t |
109109
object perform: sel withArguments: { t }.
110-
canvas camera invalidate.
111-
canvas signalUpdate
110+
canvas invalidate
112111
]
113112
]
114113

src/Roassal-Examples/RSBasicShapeExamples.class.st

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,8 +1110,7 @@ RSBasicShapeExamples >> example44AA [
11101110
canvas host hasAntialiasing
11111111
ifTrue: [ canvas host disableAntialiasing ]
11121112
ifFalse: [ canvas host enableAntialiasing ].
1113-
canvas camera invalidate.
1114-
canvas signalUpdate ]
1113+
canvas invalidate]
11151114
for: self.
11161115
^ canvas
11171116
]

src/Roassal-Examples/RSHighlightableExamples.class.st

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -547,18 +547,18 @@ RSHighlightableExamples >> example12ShowingEdges [
547547
RSHighlightableExamples >> example13Click [
548548

549549
<script: 'self new example13Click open'>
550-
| canvas shapes color interaction selectedItems interaction2 |
550+
| canvas shapes color clickInteraction selectedItems highlightInteraction |
551551
canvas := RSCanvas new.
552-
552+
canvas showDirtyRectangle.
553553
color := RSColorPalette sequential bupu3.
554554
shapes := (1 to: 20) collect: [ :m |
555-
RSBox new
556-
size: 10;
557-
model: m;
558-
draggable;
559-
withBorder;
560-
color: (color scale: m);
561-
yourself ].
555+
RSBox new
556+
size: 10;
557+
model: m;
558+
draggable;
559+
withBorder;
560+
color: (color scale: m);
561+
yourself ].
562562

563563
RSLineBuilder line
564564
canvas: canvas;
@@ -568,7 +568,8 @@ RSHighlightableExamples >> example13Click [
568568

569569
selectedItems := OrderedCollection new.
570570

571-
interaction := RSHighlightable red withLines.
571+
clickInteraction := RSHighlightable red withLines.
572+
highlightInteraction := RSHighlightable red withLines.
572573
canvas nodes
573574
when: RSMouseLeftClick
574575
do: [ :evt |
@@ -577,18 +578,18 @@ RSHighlightableExamples >> example13Click [
577578
(selectedItems includes: shape)
578579
ifTrue: [ selectedItems remove: shape ]
579580
ifFalse: [ selectedItems add: shape ].
580-
interaction doHighlightShapes: selectedItems.
581+
highlightInteraction unhighlightRecordedShapes: evt canvas.
582+
clickInteraction doHighlightShapes: selectedItems.
581583
evt signalUpdate ]
582584
for: self.
583585
canvas
584586
when: RSMouseClick
585587
do: [ :evt |
586588
selectedItems removeAll.
587-
interaction unhighlightRecordedShapes: evt.
589+
clickInteraction unhighlightRecordedShapes: evt.
588590
evt signalUpdate ]
589591
for: self.
590-
interaction2 := RSHighlightable red withLines.
591-
canvas nodes @ interaction2.
592+
canvas nodes @ highlightInteraction.
592593
RSClusterTreeLayout on: shapes.
593594
canvas zoomToFit.
594595
^ canvas

src/Roassal-Examples/RSLayoutExamples.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,13 +627,13 @@ RSLayoutExamples >> example20FlowLayout [
627627
canvas shouldShowEncompassingRectangles
628628
ifTrue: [ canvas hideEncompassingRectangles ]
629629
ifFalse: [ canvas showEncompassingRectangles ].
630-
canvas camera invalidate. canvas signalUpdate ].
630+
canvas invalidate ].
631631
'Show/Hide Underlines'.
632632
[
633633
labels first isUnderlined
634634
ifTrue: [ labels do: #normal ]
635635
ifFalse: [ labels do: #underline ].
636-
canvas camera invalidate. canvas signalUpdate
636+
canvas invalidate
637637
] } pairsDo: [ :s :a |
638638
(newLabel value: s)
639639
fontSize: 12;

src/Roassal-Interaction/RSHighlightable.class.st

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,10 @@ c @ RSCanvasController
317317
```
318318
"
319319
self
320-
when: RSHighlightEvent do: [ :evt | self record: evt shape selector: #color value: aColor ] for: self;
321-
when: RSUnHighlightEvent do: [ :evt | self restore: evt shape selector: #color ] for: self
320+
when: RSHighlightEvent do: [ :evt |
321+
self record: evt shape selector: #color value: aColor ] for: self;
322+
when: RSUnHighlightEvent do: [ :evt |
323+
self restore: evt shape selector: #color ] for: self
322324
]
323325

324326
{ #category : 'accessing' }
@@ -438,7 +440,7 @@ For example:
438440
savedValues := aShape properties
439441
at: self copyKey , selector
440442
ifAbsentPut: [ OrderedCollection new ].
441-
savedValues add: (aShape perform: selector).
443+
savedValues add: (selector value: aShape).
442444

443445
aShape
444446
perform: selector asMutator

src/Roassal-Interaction/RSZoomableCanvasInteraction.class.st

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ RSZoomableCanvasInteraction class >> zoomMove: aCanvas pixelPosition: morphPosit
5656
zero := camera fromSpaceToPixel: 0@0.
5757
camera matrix translation: morphPosition - (newPosition - zero)-(camera originMode gapDistance: camera).
5858

59-
camera invalidate.
60-
aCanvas signalUpdate.
59+
aCanvas invalidate.
6160
^ self ].
6261
aCanvas newAnimation
6362
easing: RSEasingInterpolator backOut;
@@ -70,8 +69,7 @@ RSZoomableCanvasInteraction class >> zoomMove: aCanvas pixelPosition: morphPosit
7069
zero := camera fromSpaceToPixel: 0@0.
7170
camera matrix translation: morphPosition - (newPosition - zero)-(camera originMode gapDistance: camera).
7271

73-
camera invalidate.
74-
aCanvas signalUpdate ]
72+
aCanvas invalidate ]
7573
]
7674

7775
{ #category : 'configuration' }

0 commit comments

Comments
 (0)