tests/CairoGraphicsContextTests.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 05 Apr 2016 07:44:27 +0100
changeset 75 e3ca2f982493
parent 73 ad44e7d3a06d
child 77 cdf856e78998
permissions -rw-r--r--
Fixed a baad bug in CairoGraphicsContext>>clippingBounds: Must call `cr clipReset` as `cr clip` can never make clipping bounds larger (see documentation for cairo_clip()). This fixes bard drawing of underlined Text in text editor.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/libcairo/tests' }"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
73
ad44e7d3a06d Moved CairoGraphicsContextTests to Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 72
diff changeset
     3
"{ NameSpace: Smalltalk }"
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
TestCase subclass:#CairoGraphicsContextTests
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:'cairoify view'
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'Cairo-Tests'
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
!CairoGraphicsContextTests methodsFor:'private'!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
performTest
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    16
    cairoify := true.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    17
    [
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    18
        self setUpView.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    19
        self performTestDrawingView: view.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    20
    ] ensure: [ 
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    21
        self tearDownView.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    22
    ].
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    cairoify := false.
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    24
    [
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    25
        self setUpView.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    26
        self performTestDrawingView: view.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    27
    ] ensure: [ 
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    28
        self tearDownView.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    29
    ].
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
    cairoify := nil.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
    "Created: / 26-02-2016 / 22:01:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    33
    "Modified: / 31-03-2016 / 22:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
performTestDrawingView: aView
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
    cairoify ifTrue:[ 
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
        | dGC cGC |
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
        dGC := aView instVarNamed: #gc.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
        cGC := CairoGraphicsContext onDeviceGraphicsContext: dGC.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
        [
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
            aView topView label: 'Cairo - ', self name.            
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
            aView paint: Color black on: Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
            aView backgroundColor: Color white.  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
            aView clear.          
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
            aView instVarNamed: #gc put: cGC.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
            self perform: testSelector sunitAsSymbol with: aView.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
        ] ensure:[ 
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
            aView instVarNamed: #gc put: dGC.    
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
            cGC destroyCR.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
        ].                  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    ] ifFalse:[ 
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
        aView topView label: 'Native - ', self name.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
        aView paint: Color black on: Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
        aView backgroundColor: Color white.  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
        aView clear.          
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
        self perform: testSelector sunitAsSymbol with: aView.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
    "Created: / 01-03-2016 / 13:03:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    "Modified: / 16-03-2016 / 19:03:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
! !
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
!CairoGraphicsContextTests methodsFor:'running'!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    67
setUpView
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    | top |
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
    self assert: Display notNil.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    top := StandardSystemView new.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
    top label: self name.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    top origin: 10@10 extent: (32 * 8) @ (32 * 8).       
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    view := SimpleView origin: 0.0 @ 0.0 corner: 1.0 @ 1.0 in: top.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
    top openAndWait.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    76
    "Created: / 31-03-2016 / 22:20:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    79
tearDownView
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    view notNil ifTrue:[ 
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
        view topView close.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
    84
    "Created: / 31-03-2016 / 22:20:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
! !
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
!CairoGraphicsContextTests methodsFor:'tests'!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
test_clip_01
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
    self assert: (view colorAtX: 5 y: 5) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
    view paint: Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
    view fillRectangleX: 0 y:0 width: 20 height: 20.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
    self assert: (view colorAtX: 10 y: 10) = Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
    view clippingBounds: (5 @ 5 extent: 10 @ 10).
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    view paint: Color blue.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
    view fillRectangleX: 0 y:0 width: 20 height: 20.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
    self assert: (view colorAtX: 3 y: 3) = Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    self assert: (view colorAtX: 10 y: 10) = Color blue.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
    self assert: (view colorAtX: 18 y: 18) = Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    self assert: view clippingBounds = (5@5 corner: 15@15).
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
    view clippingBounds: nil.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
    view paint: Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
    view fillRectangleX: 0 y:0 width: 40 height: 40.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    self assert: (view colorAtX: 10 y: 10) = Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
    self assert: (view colorAtX: 30 y: 30) = Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
    "Created: / 27-03-2016 / 00:01:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
test_clip_02
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
    self assert: (view colorAtX: 5 y: 5) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
    view transformation: (WindowingTransformation translation: 100@100).
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
    view paint: Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
    view fillRectangleX: 0 y:0 width: 20 height: 20.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    self assert: (view colorAtX: 10 y: 10) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
    self assert: (view colorAtX: 100 y: 100) = Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
    view clippingBounds: (5 @ 5 extent: 10 @ 10).
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
    view paint: Color blue.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
    view fillRectangleX: 0 y:0 width: 20 height: 20.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
    self assert: (view colorAtX: 3 y: 3) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
    self assert: (view colorAtX: 103 y: 103) = Color red.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
    self assert: (view colorAtX: 10 y: 10) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
    self assert: (view colorAtX: 110 y: 110) = Color blue.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    self assert: (view colorAtX: 18 y: 18) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
    self assert: (view colorAtX: 118 y: 118) = Color red.                     
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
    view clippingBounds: nil.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
    view paint: Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
    view fillRectangleX: 0 y:0 width: 40 height: 40.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
    self assert: (view colorAtX: 10 y: 10) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
    self assert: (view colorAtX: 110 y: 110) = Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    self assert: (view colorAtX: 130 y: 130) = Color yellow.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
    "Created: / 27-03-2016 / 00:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
test_infrastructure_01
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
    self assert: (view colorAtX:5 y:5) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
    view fillRectangleX: 1 y: 1 width: 10 height: 10.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
    self assert: (view colorAtX:5 y:5) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
    "Created: / 16-03-2016 / 18:34:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
72
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   151
!
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   152
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   153
test_resize_01
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   154
    self assert: (view colorAtX: 0 y:0) = Color white.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   155
    view paint: Color red.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   156
    view fillRectangleX: 0 y: 0 width: view width height: view height.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   157
    self assert: (view colorAtX:  0 y:  0) = Color red.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   158
    self assert: (view colorAtX:  view width - 1 y:  view height - 1) = Color red.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   159
    view topView extent: view extent + (100 @ 100).
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   160
    Delay waitForSeconds: 1.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   161
    view fillRectangleX: 0 y: 0 width: view width height: view height.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   162
    self assert: (view colorAtX:  0 y:  0) = Color red.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   163
    self assert: (view colorAtX:  view width - 1 y:  view height - 1) = Color red.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   164
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   165
    "Created: / 29-03-2016 / 23:41:47 / jv"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   166
    "Modified: / 02-04-2016 / 15:37:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   167
    "Modified: / 02-04-2016 / 16:10:39 / jv"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   168
!
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   169
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   170
test_subview_moved_01
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   171
    "
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   172
     https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/2"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   173
    
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   174
    | top2  view2  view3  bbB  bbA |
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   175
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   176
    top2 := StandardSystemView new.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   177
    top2 label:self name.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   178
    top2 origin:10 @ 10 extent:(32 * 8) @ (32 * 8).
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   179
    view2 := SimpleView 
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   180
            origin:0.0 @ 0.0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   181
            corner:1.0 @ 1.0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   182
            in:top2.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   183
    view3 := SimpleView 
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   184
            origin:0.0 @ 0.0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   185
            corner:1.0 @ 1.0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   186
            in:view2.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   187
    top2 openAndWait.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   188
    [
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   189
        | dGC  cGC |
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   190
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   191
        dGC := view2 instVarNamed:#gc.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   192
        cGC := CairoGraphicsContext onDeviceGraphicsContext:dGC.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   193
        view2 instVarNamed:#gc put:cGC.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   194
        view2 clear.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   195
        view3 clear.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   196
        bbB := (cGC instVarNamed:#cr) clipBounds.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   197
        view3 layout:(LayoutFrame origin:0.0 @ 0.5 corner:1.0 @ 1.0).
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   198
        view2 paint:Color blue.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   199
         "
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   200
         view3 flash.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   201
        "
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   202
        view2 
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   203
            fillRectangleX:0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   204
            y:0
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   205
            width:view2 width
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   206
            height:view2 height.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   207
        self assert:(view2 colorAtX:5 y:5) = Color blue.
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   208
    ] ensure:[ top2 close. ].
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   209
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   210
    "Created: / 25-03-2016 / 19:10:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   211
    "Modified: / 25-03-2016 / 22:32:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
3eabcca278cd Cairo context and surface management for CairoGraphicsContext reworked to work under Win32
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 71
diff changeset
   212
    "Modified: / 02-04-2016 / 16:06:05 / jv"
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
! !
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
!CairoGraphicsContextTests methodsFor:'tests - issues'!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
test_issue001_01
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   220
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
    view displayRectangleX: 0 y: 0 width: view width height: view height.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
    self assert: (view colorAtX:  0 y:  0) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
    self assert: (view colorAtX:  view width - 1 y:  view height - 1) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   225
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
    "Created: / 16-03-2016 / 18:46:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
test_issue001_02b
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   232
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   234
    view displayLineFromX: 0 y: view height - 1 toX: view width - 2 y: view height - 1.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   235
    0 to: view width - 3 do:[:x |  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   236
        self assert: (view colorAtX:  x y: view height - 1) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   237
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
    self assert: (view colorAtX:  view width - 1 y: view height - 1) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   240
    "Created: / 16-03-2016 / 19:24:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
    "Modified: / 16-03-2016 / 23:24:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
test_issue001_02l
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   245
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
    view displayLineFromX: 0 y: 0 toX: 0 y: view height - 2.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
    0 to: view height - 3 do:[:y |  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   251
        self assert: (view colorAtX: 0 y: y) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
    self assert: (view colorAtX: 0 y: view height - 1) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
    "Created: / 16-03-2016 / 19:26:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   256
    "Modified: / 16-03-2016 / 23:24:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   258
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
test_issue001_02r
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
    view displayLineFromX: view width - 1 y: 0 toX: view width - 1 y: view height - 2.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
    0 to: view height - 3 do:[:y |  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   266
        self assert: (view colorAtX: view width - 1 y: y) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   267
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
    self assert: (view colorAtX: view width - 1 y: view height - 1) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
    "Created: / 16-03-2016 / 19:27:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
    "Modified: / 16-03-2016 / 23:24:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   272
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   274
test_issue001_02t
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   275
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   278
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
    view displayLineFromX: 0 y: 0 toX: view width - 2 y: 0.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
    0 to: view width - 3 do:[:x |  
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
        self assert: (view colorAtX: x y:  0) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
    ].
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
    self assert: (view colorAtX:  view width - 1 y: 0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
    "Created: / 16-03-2016 / 19:24:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
    "Modified: / 16-03-2016 / 23:25:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   287
!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   288
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
test_issue001_03
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
    https://bitbucket.org/janvrany/stx-goodies-libcairo/issues/1
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
    "
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
    self assert: (view colorAtX: 0 y:0) = Color white.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
    view displayRectangleX: 0 y: 0 width: 10 height: 10.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
    self assert: (view colorAtX:  0 y:  0) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   296
    self assert: (view colorAtX:  9 y:  9) = Color black.
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   297
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   298
    "Created: / 16-03-2016 / 19:30:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   299
! !
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   300
75
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   301
!CairoGraphicsContextTests methodsFor:'tests - manual'!
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   302
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   303
manual_01
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   304
    "
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   305
    CairoGraphicsContextTests new manual_01
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   306
    "
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   307
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   308
    |top textView text |
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   309
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   310
    top := StandardSystemView new.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   311
    top extent:300@200.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   312
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   313
    textView := EditTextView new.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   314
    textView cairoify.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   315
    textView origin:0.0 @ 0.0 corner:1.0 @ 1.0.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   316
    top addSubView:textView.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   317
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   318
    text := 'Hello ' asText , 'World!!' asText allBold.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   319
    text allUnderwaved.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   320
    textView contents: text.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   321
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   322
    top open.
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   323
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   324
    "Created: / 04-04-2016 / 18:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   325
! !
e3ca2f982493 Fixed a baad bug in CairoGraphicsContext>>clippingBounds:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 73
diff changeset
   326
71
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   327
!CairoGraphicsContextTests class methodsFor:'documentation'!
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   328
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   329
version_HG
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   330
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   331
    ^ '$Changeset: <not expanded> $'
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   332
! !
c29ad70e032b Tests: CairoGraphicsContextTests moved to stx:goodies/libcairo/tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   333