Changeset 25696 in project


Ignore:
Timestamp:
12/11/11 22:07:32 (8 years ago)
Author:
Christian Kellermann
Message:

fps (cairo): concatenation added, clipping still is somewhat odd

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/fps/branches/cairo-backend/cairo-backend.scm

    r25675 r25696  
    1111
    1212
    13 (define surface (cairo-pdf-surface-create
    14                  "bla.pdf"
    15                  595
    16                  842))
     13(define surface
     14  (cairo-pdf-surface-create
     15   "bla.pdf"
     16   595
     17   842))
    1718
    1819(define ctx (cairo-create surface))
     
    2829
    2930   ;; resources
    30    "cairo-resources"
     31   (cairo-translate ctx 0 842)
    3132
    3233   (make-default-style)                 ; current style
     
    5354   (oink CAIRO-savegstate)      ; push the current gstate onto the stack 
    5455   (oink CAIRO-restoregstate) ; pop the gstate off the stack               
    55    (oink CAIRO-concat)    ; change the current TM                   
     56   CAIRO-concat   ; change the current TM                   
    5657
    5758   CAIRO-setcolor                ; change the current color               
     
    6566
    6667   CAIRO-stroke-or-fill                                 ; either stroke or fill       
    67    CAIRO-clip                   ; clip picture with path     
     68   (oink CAIRO-clip)                    ; clip picture with path     
    6869   CAIRO-image                  ; render the bitmap image     
    6970   (oink CAIRO-imagemask)                       ; render the bitmap image mask
     
    197198(define (CAIRO-setdash pattern offset _)
    198199  (cairo-set-dash ctx (list->f64vector (vector->list pattern)) (vector-length pattern) offset))
     200
     201(define (CAIRO-concat obj _)
     202(let ((operand (instance:operand obj)))
     203  (cond ((pt? operand)
     204 ; this is ugly, I invert the Y axis due to the swapped origing of fps and cairo
     205         (cairo-translate ctx (pt:x operand) (- (pt:y operand)))
     206         (printf " ~a ~a tra~%"
     207                 (PSnum (pt:x operand)) (PSnum (pt:y operand))))
     208        ((list?  operand)
     209         (cairo-scale ctx (car operand) (cadr operand))
     210         (printf " ~a ~a sca~%"
     211                 (PSnum (car operand)) (PSnum (cadr operand))))
     212        ((number? operand)
     213         (cairo-rotate ctx operand)
     214         (printf " ~a rot~%"
     215                 (PSnum (rad->deg operand))))
     216        ((matrix? operand)
     217         (cairo-transform/matrix ctx operand)
     218         (printf " ~a cc~%"
     219                 (PSmatrix operand)))
     220        (else (error PSconcat operand
     221                     "Argument is not a transformation operand")))))
    199222
    200223(define (CAIRO-setcolor c _)
Note: See TracChangeset for help on using the changeset viewer.