1 ;;;; cl-vectors -- Rasterizer and paths manipulation library
2 ;;;; Copyright (C) 2007 Frédéric Jolliton <frederic@jolliton.com>
4 ;;;; This library is free software; you can redistribute it and/or
5 ;;;; modify it under the terms of the Lisp Lesser GNU Public License
6 ;;;; (http://opensource.franz.com/preamble.html), known as the LLGPL.
8 ;;;; This library is distributed in the hope that it will be useful, but
9 ;;;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lisp
11 ;;;; Lesser GNU Public License for more details.
13 (defpackage #:net.tuxee.vectors
14 (:use
#:cl
#:net.tuxee.aa
#:net.tuxee.paths
)
15 (:nicknames
#:vectors
)
16 (:export
#:update-state
))
18 (in-package #:net.tuxee.vectors
)
20 (defun update-state (state paths
)
23 (update-state state path
))
24 (let ((iterator (path-iterator-segmented paths
)))
25 (multiple-value-bind (i1 k1 e1
) (path-iterator-next iterator
)
27 (when (and k1
(not e1
))
29 (let ((first-knot k1
))
31 (multiple-value-bind (i2 k2 e2
) (path-iterator-next iterator
)
34 (point-x k1
) (point-y k1
)
35 (point-x k2
) (point-y k2
))
40 (point-x k1
) (point-y k1
)
41 (point-x first-knot
) (point-y first-knot
)))))))