Skip to content

Commit

Permalink
Move antialiasing api to RSMorphicHost for issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
akevalion committed Oct 20, 2023
1 parent 6429d13 commit c6db4b8
Show file tree
Hide file tree
Showing 52 changed files with 1,020 additions and 945 deletions.
2 changes: 1 addition & 1 deletion src/Roassal-Examples/RSAnimationExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RSAnimationExamples >> example01BoxWindmill [
<script: 'self new example01BoxWindmill open'>
| canvas shapes extent points frameCount border |
canvas := RSCanvas new.
canvas aaNone.
canvas host aaNone.
canvas color: Color black.
extent := 1920@1080.
points := (0 to: extent x by: 50) flatCollect: [ :x |
Expand Down
2 changes: 1 addition & 1 deletion src/Roassal-Examples/RSBasicAnimationExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ RSBasicAnimationExamples >> example09Easing [
RSCircle new radius: 0; withBorder; noPaint ].

canvas := RSCanvas new.
canvas aaBest.
canvas host aaBest.
canvas addAnimation: (RSSequentialAnimation new
add: (RSTransitionAnimation new
duration: 2 seconds;
Expand Down
8 changes: 4 additions & 4 deletions src/Roassal-Examples/RSBasicShapeExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1099,14 +1099,14 @@ RSBasicShapeExamples >> example44AA [
canvas newAnimation
repeat;
onStepDo: [ :t |
canvas shapes last text: (canvas hasAntialiasing
canvas shapes last text: (canvas host hasAntialiasing
ifTrue: [ 'AA enabled' ]
ifFalse: [ 'AA disabled' ]).
canvas signalUpdate ];
when: RSAnimationLoopEvent do: [ :evt |
canvas hasAntialiasing
ifTrue: [ canvas disableAntialiasing ]
ifFalse: [ canvas enableAntialiasing ].
canvas host hasAntialiasing
ifTrue: [ canvas host disableAntialiasing ]
ifFalse: [ canvas host enableAntialiasing ].
canvas signalUpdate ]
for: self.
^ canvas
Expand Down
9 changes: 5 additions & 4 deletions src/Roassal-Shapes-Tests/RSAthensRendererTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
I am the test class for TSAthensRenderer
"
Class {
#name : #RSAthensRendererTest,
#superclass : #RSTest,
#category : #'Roassal-Shapes-Tests'
#name : 'RSAthensRendererTest',
#superclass : 'RSTest',
#category : 'Roassal-Shapes-Tests',
#package : 'Roassal-Shapes-Tests'
}

{ #category : #tests }
{ #category : 'tests' }
RSAthensRendererTest >> testArcCorner [
| renderer |
renderer := RSAthensRenderer new.
Expand Down
29 changes: 15 additions & 14 deletions src/Roassal-Shapes-Tests/RSBoundingTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
Test for all shapes with a matrix an one encompassing rectangle
"
Class {
#name : #RSBoundingTest,
#superclass : #RSTest,
#name : 'RSBoundingTest',
#superclass : 'RSTest',
#instVars : [
'canvas'
],
#category : #'Roassal-Shapes-Tests'
#category : 'Roassal-Shapes-Tests',
#package : 'Roassal-Shapes-Tests'
}

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> setUp [
super setUp.
canvas := RSCanvas new
]

{ #category : #tests }
{ #category : 'tests' }
RSBoundingTest >> testCreating [
| values boxes |
values := #(20 30 40 50 10).
Expand All @@ -25,14 +26,14 @@ RSBoundingTest >> testCreating [
self assert: (boxes allSatisfy: [ :s | s class == RSBox ])
]

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> testDrawBitmap [
canvas addShape: (RSBitmap new
form: (ColorForm extent: 100@100 depth: 32)).
canvas createMorph drawOnMockCanvas
]

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> testDrawBorder [
canvas addShape: (RSEllipse new
radius: 100;
Expand All @@ -41,7 +42,7 @@ RSBoundingTest >> testDrawBorder [
canvas createMorph drawOnMockCanvas
]

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> testDrawBoxCornerRadius [
canvas addShape: (RSBox new
extent: 100@100;
Expand All @@ -50,7 +51,7 @@ RSBoundingTest >> testDrawBoxCornerRadius [
canvas createMorph drawOnMockCanvas
]

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> testDrawPolygon [
canvas addShape: (RSPolygon new).
canvas addShape: (RSPolygon new
Expand All @@ -64,7 +65,7 @@ RSBoundingTest >> testDrawPolygon [
canvas createMorph drawOnMockCanvas
]

{ #category : #running }
{ #category : 'running' }
RSBoundingTest >> testDrawRing [
| r |
r := RSPieSlice new.
Expand Down Expand Up @@ -105,7 +106,7 @@ RSBoundingTest >> testDrawRing [
canvas createMorph drawOnMockCanvas
]

{ #category : #tests }
{ #category : 'tests' }
RSBoundingTest >> testFromRectangle [

| box |
Expand All @@ -117,7 +118,7 @@ RSBoundingTest >> testFromRectangle [
self assert: box extent equals: 40 @ 30
]

{ #category : #tests }
{ #category : 'tests' }
RSBoundingTest >> testHasChildren [
| b |
b := RSBox new.
Expand All @@ -126,15 +127,15 @@ RSBoundingTest >> testHasChildren [
self deny: b hasChildren
]

{ #category : #tests }
{ #category : 'tests' }
RSBoundingTest >> testPosition [
| b |
b := RSBox new.
self assert: b position equals: 0@0.
b position: 0@0
]

{ #category : #tests }
{ #category : 'tests' }
RSBoundingTest >> testTranslateTopLeftTo [

| b |
Expand Down
Loading

0 comments on commit c6db4b8

Please sign in to comment.